File tree 1 file changed +7
-2
lines changed
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
301
301
return ;
302
302
303
303
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);
304
309
305
310
[font release ];
306
- font = [newFont retain ] ;
311
+ font = ( NSFont *)fontRef ;
307
312
308
313
float cellWidthMultiplier = [[NSUserDefaults standardUserDefaults ]
309
314
floatForKey: MMCellWidthMultiplierKey];
@@ -315,7 +320,7 @@ - (void)setFont:(NSFont *)newFont
315
320
cellSize.width = columnspace + ceil (em * cellWidthMultiplier);
316
321
cellSize.height = linespace + defaultLineHeightForFont (font);
317
322
318
- fontDescent = ceil (CTFontGetDescent ((CTFontRef)newFont ));
323
+ fontDescent = ceil (CTFontGetDescent (fontRef ));
319
324
320
325
[fontCache removeAllObjects ];
321
326
}
You can’t perform that action at this time.
0 commit comments