Skip to content

Commit 49e7a1d

Browse files
committed
Remove the ceil() call around fontDescent in Core Text renderer
I have looked and I do not believe there is a good reason to do this rounding up at all. I believe the motivation is to align the baseline with the pixel boundary, but I don't believe that is necessary, given that Core Text will properly perform the correct antialiasing for us. Most texts aren't directly aligned at the baseline anyway. Before, that ceil() option is a reason why sometimes fonts would feel pushed upwards, clipping emojis to the top, and creating a lopsided effect for fonts like Fira Code (h11), since we draw the boxes aligned to the line height at the bottom of the descender, meaning the ceil() has an effect of pushing the text up.
1 parent e05f23b commit 49e7a1d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/MacVim/MMCoreTextView.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ - (void)setFont:(NSFont *)newFont
434434
} else {
435435
font = [newFont retain];
436436
}
437-
fontDescent = ceil(CTFontGetDescent((CTFontRef)font));
437+
fontDescent = CTFontGetDescent((CTFontRef)font);
438438
fontAscent = CTFontGetAscent((CTFontRef)font);
439439
fontXHeight = CTFontGetXHeight((CTFontRef)font);
440440

0 commit comments

Comments
 (0)