win32: TWin32WidgetSet.CreateFontIndirect: correctly resolve default font height. Issue #36571. Patch from Yuriy Sydorov

git-svn-id: trunk@62549 -
This commit is contained in:
ondrej 2020-01-14 14:34:02 +00:00
parent d3dab158dc
commit 000aa3e559

View File

@ -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;