Skip to content

Commit 7956ed5

Browse files
authored
Merge pull request #703 from Giemsa/fix/invalid_font_on_high_sierra
Fix: failed to select some fonts on high sierra
2 parents 585d52c + 1a7ed92 commit 7956ed5

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

src/MacVim/MMCoreTextView.m

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff 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];

0 commit comments

Comments
 (0)