mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-23 20:50:40 +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;
|
FontName := LogFont.lfFaceName;
|
||||||
|
|
||||||
TempLogFont := LogFont;
|
TempLogFont := LogFont;
|
||||||
if SameText(FontName, DefFontData.Name) then
|
if IsFontNameDefault(FontName) then
|
||||||
begin
|
begin
|
||||||
TempLogFontW.lfFaceName := UTF8ToUTF16(FMetrics.lfMessageFont.lfFaceName); // FMetrics must be UTF16
|
TempLogFontW.lfFaceName := UTF8ToUTF16(FMetrics.lfMessageFont.lfFaceName); // FMetrics must be UTF16
|
||||||
if TempLogFont.lfHeight = 0 then
|
|
||||||
TempLogFont.lfHeight := FMetrics.lfMessageFont.lfHeight;
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
TempLogFontW.lfFaceName := UTF8ToUTF16(FontName);
|
TempLogFontW.lfFaceName := UTF8ToUTF16(FontName);
|
||||||
end;
|
end;
|
||||||
|
if TempLogFont.lfHeight = 0 then
|
||||||
|
TempLogFont.lfHeight := FMetrics.lfMessageFont.lfHeight;
|
||||||
Result := Windows.CreateFontIndirectW(@TempLogFontW);
|
Result := Windows.CreateFontIndirectW(@TempLogFontW);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user