Open ottta opened 1 month ago
Comment on commit 972eb52 Check Use Typo Metrics to get more consistent vertical metrics
More important would be to just make all 3 metrices the same (already the case), and avoid using gap values.
Hmm, and then the released font does already have that set, see here:
fini@Air ~ % font-line report ~/Downloads/monaspace-v1.101/fonts/otf/MonaspaceArgon-Regular.otf
=== /Users/fini/Downloads/monaspace-v1.101/fonts/otf/MonaspaceArgon-Regular.otf ===
Version 1.101 (Monaspace Argon)
SHA1: 02edd009f5cf7e196e311e7167dbf62b6fac3806
::::::::::::::::::::::::::::::::::::::::::::::::::
Metrics
::::::::::::::::::::::::::::::::::::::::::::::::::
[head] Units per Em: 2000
[head] yMax: 1951
[head] yMin: -760
[OS/2] CapHeight: 1460
[OS/2] xHeight: 1027
[OS/2] TypoAscender: 1565
[OS/2] TypoDescender: -435
[OS/2] WinAscent: 1878
[OS/2] WinDescent: 522
[hhea] Ascent: 1565
[hhea] Descent: -435
[hhea] LineGap: 400
[OS/2] TypoLineGap: 400
::::::::::::::::::::::::::::::::::::::::::::::::::
Ascent to Descent Calculations
::::::::::::::::::::::::::::::::::::::::::::::::::
[hhea] Ascent to Descent: 2000
[OS/2] TypoAscender to TypoDescender: 2000
[OS/2] WinAscent to WinDescent: 2400
::::::::::::::::::::::::::::::::::::::::::::::::::
Delta Values
::::::::::::::::::::::::::::::::::::::::::::::::::
[hhea] Ascent to [OS/2] TypoAscender: 0
[hhea] Descent to [OS/2] TypoDescender: 0
[OS/2] WinAscent to [OS/2] TypoAscender: 313
[OS/2] WinDescent to [OS/2] TypoDescender: 87
::::::::::::::::::::::::::::::::::::::::::::::::::
Baseline to Baseline Distances
::::::::::::::::::::::::::::::::::::::::::::::::::
hhea metrics: 2400
typo metrics: 2400
win metrics: 2400
[OS/2] fsSelection USE_TYPO_METRICS bit set: True
::::::::::::::::::::::::::::::::::::::::::::::::::
Ratios
::::::::::::::::::::::::::::::::::::::::::::::::::
hhea metrics / UPM: 1.2
typo metrics / UPM: 1.2
win metrics / UPM: 1.2
fini@Air ~ %
Comment on commit 972eb52
Check Use Typo Metrics to get more consistent vertical metrics
More important would be to just make all 3 metrices the same (already the case), and avoid using gap values.
Hmm, and then the released font does already have that set, see here:
fini@Air ~ % font-line report ~/Downloads/monaspace-v1.101/fonts/otf/MonaspaceArgon-Regular.otf === /Users/fini/Downloads/monaspace-v1.101/fonts/otf/MonaspaceArgon-Regular.otf === Version 1.101 (Monaspace Argon) SHA1: 02edd009f5cf7e196e311e7167dbf62b6fac3806 :::::::::::::::::::::::::::::::::::::::::::::::::: Metrics :::::::::::::::::::::::::::::::::::::::::::::::::: [head] Units per Em: 2000 [head] yMax: 1951 [head] yMin: -760 [OS/2] CapHeight: 1460 [OS/2] xHeight: 1027 [OS/2] TypoAscender: 1565 [OS/2] TypoDescender: -435 [OS/2] WinAscent: 1878 [OS/2] WinDescent: 522 [hhea] Ascent: 1565 [hhea] Descent: -435 [hhea] LineGap: 400 [OS/2] TypoLineGap: 400 :::::::::::::::::::::::::::::::::::::::::::::::::: Ascent to Descent Calculations :::::::::::::::::::::::::::::::::::::::::::::::::: [hhea] Ascent to Descent: 2000 [OS/2] TypoAscender to TypoDescender: 2000 [OS/2] WinAscent to WinDescent: 2400 :::::::::::::::::::::::::::::::::::::::::::::::::: Delta Values :::::::::::::::::::::::::::::::::::::::::::::::::: [hhea] Ascent to [OS/2] TypoAscender: 0 [hhea] Descent to [OS/2] TypoDescender: 0 [OS/2] WinAscent to [OS/2] TypoAscender: 313 [OS/2] WinDescent to [OS/2] TypoDescender: 87 :::::::::::::::::::::::::::::::::::::::::::::::::: Baseline to Baseline Distances :::::::::::::::::::::::::::::::::::::::::::::::::: hhea metrics: 2400 typo metrics: 2400 win metrics: 2400 [OS/2] fsSelection USE_TYPO_METRICS bit set: True :::::::::::::::::::::::::::::::::::::::::::::::::: Ratios :::::::::::::::::::::::::::::::::::::::::::::::::: hhea metrics / UPM: 1.2 typo metrics / UPM: 1.2 win metrics / UPM: 1.2 fini@Air ~ %
*The released version (old files: `fonts/otf/.otf`)**
![]()
Ascenders Descenders LineGap UPM 1565 -435 400
2000 (Ascender + Abs(Descender) + LineGap) / UPM =
LineHeight
(1565 + Abs(-435) +400
) / 2000 =1.2
Note:
LineGap
value400
However, the above metrics caused Latin Capital Letter
to not vertically center across the vertical bounding box:
Reference: https://googlefonts.github.io/gf-guide/metrics.html#9-uppercases-should-be-centered-in-the-text-line
*The tweaked version (this PR: `fonts/ttf/.ttf`)**
![]()
Ascenders Descenders LineGap UPM 1930 -470 0
2000 (Ascender + Abs(Descender) + LineGap) / UPM =
LineHeight
(1930 + Abs(-470) +0
) / 2000 =1.2
Note:
LineGap
value0
Even though I changed the Ascenders
, Descenders
, and LineGap
values, the line-height
values remained the same as before and are consistent accross platforms.
1.2
for default line-height
#169 Reference: https://googlefonts.github.io/gf-guide/metrics.html#8-linegap-values-must-be-0
Well, the matrices were all the same, at least the baseline to baseline distance. 🤷♀️
More important would be to just make all 3 metrices the same (already the case), and avoid using gap values.
That's what you did, and what I said one should do. Set gaps to zero, they are a headache for fonts that are intended for terminals anyhow.
If the matrices are the same they will be rendered the same and "use typo metrics" (which is useless anyhow, as you know if you read all the documentation) is superfluous. The problem is that some terminals ignore GAP, some put it half top and bottom, some on the bottom, some on the top. That also affects this "not vertically centered"; the problem depends on the terminal used and how it interprets (if at all) the GAP.
Just setting the use-typo-metrics usually does not change anything, as the typo values ought to be used in any case ;-)
Google fonts has some "suggestions" that one can follow or not, like this one
If you think Google is God, of course one needs to follow.
And why do you link this, as like, it contradicts what I said, when it is exactly my point?
I don't get it. Ciao.
Have you tried the .ttf
files? And don't you see the difference?
Old MonaspaceArgonVarVF[wght,wdth,slnt].ttf
iTerm2
MacOS Terminal
New MonaspaceKryptonVarVF.ttf
exported from GlyphsApp (not in this PR)
iTerm2
MacOS Terminal
Or from default HTML Button component
Google Chrome (Version 125.0.6422.142)
![]()
Safari (Version 17.4.1)
Firefox (Version 122.0.1)
Opera (Version: 109.0.5097.68)
This PR only tweaks all
vertical metrics
andfont info
on each.glyphs
file1. Avoid write lastChange and displayString to version control
2. Check
Use Typo Metrics
to get more consistent vertical metrics3. Resolve #21 #37 #169
21 #37 "Hanging Font": Miss configure
typo
andhhea
value. Adjust this value will "centering" glyphs across the vertical bounding box.169 Probably same as above, tweaking
typo
andhhea
does resolve theline-height
orleading
default to1.2
or120%
from the upm value.Note that "Gcommaaccent" may be truncated in environments that have
overflow: hidden
.Please see these documentation:
4. Resolve #111 not recognized as monospace font Because
isFixedPitch
is not set, the record in the POST TableisFixedPitch
has zero value. Please refer to these:These images below illustrate
Aring
on theoverflow: hidden
environmentBefore: Top of Aring seems clipping because miss configuration
typo/hhea
After: Resolve clipping and vertically balance basic latin