mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-11 15:37:29 +02:00
Fix: failed to select some fonts on high sierra
This commit is contained in:
@@ -294,11 +294,7 @@ defaultAdvanceForFont(NSFont *font)
|
||||
double em = round(defaultAdvanceForFont(newFont));
|
||||
double pt = round([newFont pointSize]);
|
||||
|
||||
NSDictionary *attr = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
[newFont displayName], (NSString*)kCTFontNameAttribute,
|
||||
[NSNumber numberWithFloat:pt], (NSString*)kCTFontSizeAttribute, nil];
|
||||
CTFontDescriptorRef desc = CTFontDescriptorCreateWithAttributes(
|
||||
(CFDictionaryRef)attr);
|
||||
CTFontDescriptorRef desc = CTFontDescriptorCreateWithNameAndSize((CFStringRef)[newFont fontName], pt);
|
||||
CTFontRef fontRef = CTFontCreateWithFontDescriptor(desc, pt, NULL);
|
||||
CFRelease(desc);
|
||||
|
||||
@@ -787,7 +783,7 @@ defaultAdvanceForFont(NSFont *font)
|
||||
NSFont *newFont = [sender convertFont:font];
|
||||
|
||||
if (newFont) {
|
||||
NSString *name = [newFont displayName];
|
||||
NSString *name = [newFont fontName];
|
||||
unsigned len = [name lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
|
||||
if (len > 0) {
|
||||
NSMutableData *data = [NSMutableData data];
|
||||
|
||||
Reference in New Issue
Block a user