mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-18 19:29:31 +02:00
win32: TWin32WidgetSet.CreateFontIndirect: correctly resolve default font height. Issue #36571. Patch from Yuriy Sydorov
git-svn-id: trunk@62549 -
This commit is contained in:
parent
d3dab158dc
commit
000aa3e559
@ -849,16 +849,16 @@ begin
|
||||
FontName := LogFont.lfFaceName;
|
||||
|
||||
TempLogFont := LogFont;
|
||||
if SameText(FontName, DefFontData.Name) then
|
||||
if IsFontNameDefault(FontName) then
|
||||
begin
|
||||
TempLogFontW.lfFaceName := UTF8ToUTF16(FMetrics.lfMessageFont.lfFaceName); // FMetrics must be UTF16
|
||||
if TempLogFont.lfHeight = 0 then
|
||||
TempLogFont.lfHeight := FMetrics.lfMessageFont.lfHeight;
|
||||
end
|
||||
else
|
||||
begin
|
||||
TempLogFontW.lfFaceName := UTF8ToUTF16(FontName);
|
||||
end;
|
||||
if TempLogFont.lfHeight = 0 then
|
||||
TempLogFont.lfHeight := FMetrics.lfMessageFont.lfHeight;
|
||||
Result := Windows.CreateFontIndirectW(@TempLogFontW);
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user