mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-18 19:29:31 +02:00
cocoa: updating font dialog to return the selected font size. bug #33990
git-svn-id: trunk@62528 -
This commit is contained in:
parent
d9fdf6d15e
commit
4ac51dd8f4
@ -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;
|
||||
Traits := NSFontManager.sharedFontManager.traitsOfFont(AFont.Font);
|
||||
if (Traits and NSFontBoldTrait) <> 0 then
|
||||
ALogFont^.lfWeight := FW_BOLD
|
||||
|
@ -137,6 +137,9 @@ type
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
CocoaInt;
|
||||
|
||||
// API irony.
|
||||
// In LCL the base dialog is TOpenDialog (savedialog inherits from it)
|
||||
// In Cocoa the base dialog is SaveDialog (opendialog inherites from it)
|
||||
@ -654,6 +657,8 @@ begin
|
||||
oldFont := oldHandle.Font;
|
||||
//oldFont := NSFont.fontWithName_size(NSFont.systemFontOfSize(0).fontDescriptor.postscriptName, 0);
|
||||
newFont := FontPanel.panelConvertFont(oldFont);
|
||||
if (CocoaBasePPI<>72) then
|
||||
newFont := NSFont.fontWithDescriptor_size(newFont.fontDescriptor, newFont.pointSize * CocoaBasePPI / 72);
|
||||
newHandle := TCocoaFont.Create(newFont);
|
||||
FontDialog.Font.Handle := HFONT(newHandle);
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user