Skip to content

Commit e05f23b

Browse files
committed
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.
1 parent 233e188 commit e05f23b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/MacVim/Base.lproj/Preferences.xib

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,8 @@
425425
<button id="A48-s0-kdR" userLabel="Preserve Line Spacing">
426426
<rect key="frame" x="189" y="-1" width="244" height="18"/>
427427
<autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
428-
<string key="toolTip">Some fonts have non-standard built-in line spacings (anything other than 1). If this is checked, MacVim will use the font's specified line spacing to calculate line height. Otherwise, it will just set it to 1, which helps if you would like a more compact spacing without having to install another font.</string>
429-
<buttonCell key="cell" type="check" title="Preserve font line spacing" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="SeR-yl-Gtz" userLabel="Preserve Line Spacing">
428+
<string key="toolTip">macOS can sometimes use a conservative approach to calculating line spacing for a font (by setting a 1.2 line spacing). This could potentially lead to line spacing feeling too wide. Unchecking this will use a tighter calculation and use a 1.0 line spacing instead.</string>
429+
<buttonCell key="cell" type="check" title="Use macOS line spacing calculation" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="SeR-yl-Gtz" userLabel="Preserve Line Spacing">
430430
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
431431
<font key="font" metaFont="system"/>
432432
</buttonCell>

0 commit comments

Comments
 (0)