New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default font #388
base: master
Are you sure you want to change the base?
Default font #388
Conversation
params.DefaultFont = &defaultFont; | ||
params.Width = p->AreaWidth; | ||
params.Align = (uiDrawTextAlign) uiComboboxSelected(alignment); | ||
textLayout = uiDrawNewTextLayout(¶ms); | ||
uiDrawText(p->Context, textLayout, 0, 0); | ||
uiDrawFreeTextLayout(textLayout); | ||
|
||
//TODO RENAME? | ||
uiFreeFontButtonFont(&defaultFont); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uiDrawLoadDefaultFont
behaves exactly like uiFontButtonFont
in that the family needs to be freed, so uiFreeFontButtonFont
needs to be called. Should there be a uiFreeDefaultFont
function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Partial review for now.
windows/drawtext.cpp
Outdated
collection = uiprivLoadFontCollection(); | ||
family = uiprivFontCollectionFamilyName(collection, dwfamily); | ||
|
||
pixels = GetDeviceCaps(GetDC(NULL), LOGPIXELSY); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how correct this part is (will check again later), but I do know you're leaking the result of GetDC(NULL)
here.
Should this rather be called "system font"? |
Either that or DefaultControlFont. |
Yes, control sounds appropriate uiLoadControlFont(f);
// or
uiLoadDefaultControlFont(f); |
I vote for |
But "draw" is only used in function directly related to area drawing. It's also |
@mischnic Right, |
This updates #279 to the new api.
Closes #279