Cocoa fonts: comments

git-svn-id: trunk@62530 -
This commit is contained in:
ondrej 2020-01-12 01:01:18 +00:00
parent 18ce1577f9
commit 98c349fc08
2 changed files with 2 additions and 2 deletions

View File

@ -646,7 +646,7 @@ begin
if ALogFont.lfHeight = 0 then
FSize := Round(NSFont.systemFontSize)
else
FSize := Abs(ALogFont.lfHeight);
FSize := Abs(ALogFont.lfHeight); // To-Do: emulate WinAPI difference between negative and absolute height values
// create font attributes
Win32Weight := ALogFont.lfWeight;

View File

@ -1300,7 +1300,7 @@ begin
Result := SizeOf(TLogFont);
FillChar(ALogFont^, SizeOf(ALogFont^), 0);
ALogFont^.lfFaceName := AFont.Name;
ALogFont^.lfHeight := -AFont.Size;
ALogFont^.lfHeight := -AFont.Size; // Cocoa supports only full height (with leading) that corresponds with a negative value in WinAPI
Traits := NSFontManager.sharedFontManager.traitsOfFont(AFont.Font);
if (Traits and NSFontBoldTrait) <> 0 then
ALogFont^.lfWeight := FW_BOLD