Skip to content

Commit 800da6f

Browse files
committed
Fixed advance fonts are no longer needed; now handled at render time.
1 parent 650545e commit 800da6f

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

src/MacVim/MMCoreTextView.m

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -133,21 +133,6 @@ - (void)invertBlockFromRow:(int)row column:(int)col numRows:(int)nrows
133133
return [@"m" sizeWithAttributes:a].width;
134134
}
135135

136-
NSFont *fontWithFixedAdvanceCascadeList(NSFont *font, CGFloat advance) {
137-
NSArray *cascadeList = (NSArray*)CTFontCopyDefaultCascadeListForLanguages((CTFontRef)font, nil);
138-
NSMutableArray *fixedWidthCascadeList = [NSMutableArray arrayWithCapacity:cascadeList.count];
139-
NSDictionary *fixedAdvanceAttributeDict = @{
140-
NSFontFixedAdvanceAttribute: @(advance),
141-
};
142-
for (NSFontDescriptor* descriptor in cascadeList) {
143-
[fixedWidthCascadeList addObject:[descriptor fontDescriptorByAddingAttributes:fixedAdvanceAttributeDict]];
144-
}
145-
return [NSFont fontWithDescriptor:[font.fontDescriptor fontDescriptorByAddingAttributes:@{
146-
NSFontCascadeListAttribute: fixedWidthCascadeList,
147-
NSFontFixedAdvanceAttribute: @(advance),
148-
}] size:font.pointSize];
149-
}
150-
151136
typedef struct {
152137
unsigned color;
153138
int shape;
@@ -405,7 +390,7 @@ - (void)setFont:(NSFont *)newFont
405390
cellSize.height = linespace + defaultLineHeightForFont(newFont);
406391

407392
[font release];
408-
font = [fontWithFixedAdvanceCascadeList(newFont, cellSize.width) retain];
393+
font = [newFont retain];
409394
fontDescent = ceil(CTFontGetDescent((CTFontRef)font));
410395

411396
[self clearAll];
@@ -422,7 +407,7 @@ - (void)setWideFont:(NSFont *)newFont
422407
if (font) [self setWideFont:font];
423408
} else if (newFont != fontWide) {
424409
[fontWide release];
425-
fontWide = [fontWithFixedAdvanceCascadeList(newFont, cellSize.width * 2) retain];
410+
fontWide = [newFont retain];
426411
}
427412
}
428413

0 commit comments

Comments
 (0)