File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -301,9 +301,14 @@ - (void)setFont:(NSFont *)newFont
301301 return ;
302302
303303 double em = round (defaultAdvanceForFont (newFont));
304+ double pt = round ([newFont pointSize ]);
305+
306+ CTFontDescriptorRef desc = CTFontDescriptorCreateWithNameAndSize ((CFStringRef)[newFont fontName ], pt);
307+ CTFontRef fontRef = CTFontCreateWithFontDescriptor (desc, pt, NULL );
308+ CFRelease (desc);
304309
305310 [font release ];
306- font = [newFont retain ] ;
311+ font = ( NSFont *)fontRef ;
307312
308313 float cellWidthMultiplier = [[NSUserDefaults standardUserDefaults ]
309314 floatForKey: MMCellWidthMultiplierKey];
@@ -315,7 +320,7 @@ - (void)setFont:(NSFont *)newFont
315320 cellSize.width = columnspace + ceil (em * cellWidthMultiplier);
316321 cellSize.height = linespace + defaultLineHeightForFont (font);
317322
318- fontDescent = ceil (CTFontGetDescent ((CTFontRef)newFont ));
323+ fontDescent = ceil (CTFontGetDescent (fontRef ));
319324
320325 [fontCache removeAllObjects ];
321326}
You can’t perform that action at this time.
0 commit comments