From e05f23b3b99993e9932e961942f3a465ee7277a7 Mon Sep 17 00:00:00 2001 From: Yee Cheng Chin Date: Fri, 20 Jan 2023 18:25:15 -0800 Subject: [PATCH 1/4] Rename the "preserve line spacing" setting to "use macOS calculation" The setting was added to "preserve" the font's original line spacing intents, but after further investigation I cannot find why Apple's calculation for font line spacing to be so wide. Furthermore it's quite odd because the default line spacing is wide, but the only thing that setting does is by re-initializing the font under Core Text (instead of using NSFont like the default) using CTFont and somehow the issue is fixed. Inspecting font metrics (using ttx) also didn't seem to give any hints why the spacing are so wide (e.g. ascent / descent / line gap etc all look fine). A StackOverflow comment seems to suggest that Apple is simply adding a 1.2x scale to some fonts (https://stackoverflow.com/questions/5511830/how-does-line-spacing-work-in-core-text-and-why-is-it-different-from-nslayoutm) which seems to match the observation. My guess is that Apple looks at some fonts and think they are too aggressive in their font metrics design and "helpfully" introduces a 1.2x multiplier to space them out, where Core Text is lower level than AppKit and therefore does not have this auto-inflation. By renaming the option it should make it clearer that this is a somewhat arbitrary distinction instead of it being an inherent property of the font. --- src/MacVim/Base.lproj/Preferences.xib | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MacVim/Base.lproj/Preferences.xib b/src/MacVim/Base.lproj/Preferences.xib index 228c305069..3bad81f8bb 100644 --- a/src/MacVim/Base.lproj/Preferences.xib +++ b/src/MacVim/Base.lproj/Preferences.xib @@ -425,8 +425,8 @@