cocoa: updating font dialog initialization. bug #33990

git-svn-id: trunk@62529 -
This commit is contained in:
dmitry 2020-01-12 00:45:13 +00:00
parent 4ac51dd8f4
commit 18ce1577f9

View File

@ -548,6 +548,7 @@ var
accessoryView: NSView; accessoryView: NSView;
lRect: NSRect; lRect: NSRect;
okButton, cancelButton: NSButton; okButton, cancelButton: NSButton;
fn : NSFont;
begin begin
{$IFDEF VerboseWSClass} {$IFDEF VerboseWSClass}
DebugLn('TCocoaWSFontDialog.ShowModal for ' + ACommonDialog.Name); DebugLn('TCocoaWSFontDialog.ShowModal for ' + ACommonDialog.Name);
@ -557,7 +558,10 @@ begin
fontPanel := NSFontPanel.sharedFontPanel(); fontPanel := NSFontPanel.sharedFontPanel();
inFont := TCocoaFont(FontDialog.Font.Handle); inFont := TCocoaFont(FontDialog.Font.Handle);
fontPanel.setPanelFont_isMultiple(inFont.Font, False); fn := inFont.Font;
if (CocoaBasePPI<>72) and (CocoaBasePPI<>0) then
fn := NSFont.fontWithDescriptor_size(fn.fontDescriptor, fn.pointSize / CocoaBasePPI * 72);
fontPanel.setPanelFont_isMultiple(fn, False);
FontDelegate := TFontPanelDelegate.alloc.init(); FontDelegate := TFontPanelDelegate.alloc.init();
FontDelegate.FontPanel := FontPanel; FontDelegate.FontPanel := FontPanel;