File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -294,11 +294,7 @@ - (void)setFont:(NSFont *)newFont
294294 double em = round (defaultAdvanceForFont (newFont));
295295 double pt = round ([newFont pointSize ]);
296296
297- NSDictionary *attr = [NSDictionary dictionaryWithObjectsAndKeys:
298- [newFont displayName ], (NSString *)kCTFontNameAttribute ,
299- [NSNumber numberWithFloat: pt], (NSString *)kCTFontSizeAttribute , nil ];
300- CTFontDescriptorRef desc = CTFontDescriptorCreateWithAttributes (
301- (CFDictionaryRef)attr);
297+ CTFontDescriptorRef desc = CTFontDescriptorCreateWithNameAndSize ((CFStringRef)[newFont fontName ], pt);
302298 CTFontRef fontRef = CTFontCreateWithFontDescriptor (desc, pt, NULL );
303299 CFRelease (desc);
304300
@@ -787,7 +783,7 @@ - (void)changeFont:(id)sender
787783 NSFont *newFont = [sender convertFont: font];
788784
789785 if (newFont) {
790- NSString *name = [newFont displayName ];
786+ NSString *name = [newFont fontName ];
791787 unsigned len = [name lengthOfBytesUsingEncoding: NSUTF8StringEncoding];
792788 if (len > 0 ) {
793789 NSMutableData *data = [NSMutableData data ];
You can’t perform that action at this time.
0 commit comments