-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolve several major issues: Vertical Metrics, Monospace Recognition #227
base: main
Are you sure you want to change the base?
Conversation
- Display string can be heavy process while opening the .glyphs file - lastChange possibly adding new unnecessary record history, such as last saved file or hit cmd + s
Prepare tweaking vertical metrics value Please refer to this opentype guideline: - https://learn.microsoft.com/en-us/typography/opentype/spec/os2#fsselection - https://googlefonts.github.io/gf-guide/metrics.html#5-use_typo_metrics-must-be-enabled
Highest & Lowest glyphs on each file: - Monaspace Xenon Var.glyphs — Uring (2011.0), Gcommaaccent (-786.0) - Monaspace Xenon.glyph — Uring (2011.0), Gcommaaccent (-786.0) - Monaspace Argon Var.glyph — lacute (1988.0), Gcommaaccent (-786.0) - Monaspace Argon.glyph — lacute (1988.0), Gcommaaccent (-786.0) - Monaspace Krypton Var.glyph — lacute (1988.0), Gcommaaccent (-786.0) - Monaspace Krypton.glyph — lacute (1988.0), Gcommaaccent (-786.0) - Monaspace Neon Var.glyph — lacute (1988.0), Gcommaaccent (-786.0) - Monaspace Neon.glyph — lacute (1988.0), Gcommaaccent (-786.0) Please refer to these documentation: - winAscent: https://learn.microsoft.com/en-us/typography/opentype/spec/os2#uswinascent - winDescent: https://learn.microsoft.com/en-us/typography/opentype/spec/os2#uswindescent - https://googlefonts.github.io/gf-guide/metrics.html#6-winascent-and-windescent-values-must-be-the-same-as-the-familys-tallestdeepest-ymin-and-ymax-bounding-box-values
- githubnext#21 githubnext#37 "Hanging Font": Miss configure `typo` and `hhea` value. Adjust this value will "centering" glyphs across the vertical bounding box. - githubnext#169 Probably same as above, tweaking `typo` and `hhea` does resolve the `line-height` or `leading` default to `1.2` or `120%` from the upm value. UPM = 2000 (typo/hhea)Ascenders = 1930 (typo/hhea)Descenders = -470 (typo/hhea)LineGap = 0 Total: ascender + abs(descenders) + linegap = 2400 Note that "Gcommaaccent" may be truncated in environments that have `overflow: hidden` Please see these documentation: - https://googlefonts.github.io/gf-guide/metrics.html#6-winascent-and-windescent-values-must-be-the-same-as-the-familys-tallestdeepest-ymin-and-ymax-bounding-box-values - https://googlefonts.github.io/gf-guide/metrics.html#11-the-sum-of-the-fonts-vertical-metric-values-absolute-should-be-20-30-greater-than-the-fonts-upm
Because `isFixedPitch` is not set, the record in the POST Table `isFixedPitch` has zero value. Please refer to these: - https://learn.microsoft.com/en-us/typography/opentype/spec/post#header - https://googlefonts.github.io/gf-guide/requirements.html#monospace-fonts
@@ -53,6 +53,10 @@ value = 0; | |||
{ | |||
name = "Use Typo Metrics"; | |||
value = 1; | |||
}, | |||
{ | |||
name = isFixedPitch; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be automatically set if it would be valid iirc.
Forcing the value to 1
while the font is not isFixedPitch
can lead to problems, see for example google/fonts#225
Anyhow, the root cause should be in
and supposedly it is fixed now. But it is not. I can redo the search for offending glyphs if need be.
Here the isFixedPitch value in the font file:
fini@Air ~ % showttf ~/Downloads/monaspace-v1.101/fonts/otf/MonaspaceArgon-Regular.otf | tail -n +1065 | head
Required tables: glyf and loca have been replaced by CFF => OpenType
post table (at 7312)
format=00030000
italicAngle=0
underlinePos=-70
underlineWidth=72
fixedpitch=0
mem1=0
mem2=0
mem3=0
mem4=0
fini@Air ~ %
Here a screenshot of the "warning" to set it in Glyphs ;-)
![Screenshot 2024-06-07 at 17 13 21](https://private-user-images.githubusercontent.com/16012374/337706364-047e4aa0-2632-48e4-bdbd-7b0a01ebf17d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU1OTY0MDAsIm5iZiI6MTcyNTU5NjEwMCwicGF0aCI6Ii8xNjAxMjM3NC8zMzc3MDYzNjQtMDQ3ZTRhYTAtMjYzMi00OGU0LWJkYmQtN2IwYTAxZWJmMTdkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA2VDA0MTUwMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTBkMTQyZTkxZmQ5ODk5OWZiOGM3OGZhYTYzZTZiYzhjMzVkZjgyNTNiN2U3NzliYTNlY2Q4Y2M1OTY2OWExYjEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.oc3ftxPIONMxy4JmQcAOb-6Rb1mNa99BIxecE89grs8)
Comment on commit 972eb52 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:
|
It appears to be identical, but it is not. See the differences below.The released version (old files:
However, the above metrics caused
Reference: https://googlefonts.github.io/gf-guide/metrics.html#9-uppercases-should-be-centered-in-the-text-line The tweaked version (this PR:
Even though I changed the
Reference: https://googlefonts.github.io/gf-guide/metrics.html#8-linegap-values-must-be-0 |
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 metrics- https://learn.microsoft.com/en-us/typography/opentype/spec/os2#fsselection
- https://googlefonts.github.io/gf-guide/metrics.html#5-use_typo_metrics-must-be-enabled
3. 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:
- https://googlefonts.github.io/gf-guide/metrics.html#6-winascent-and-windescent-values-must-be-the-same-as-the-familys-tallestdeepest-ymin-and-ymax-bounding-box-values
- https://googlefonts.github.io/gf-guide/metrics.html#11-the-sum-of-the-fonts-vertical-metric-values-absolute-should-be-20-30-greater-than-the-fonts-upm
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:
- https://learn.microsoft.com/en-us/typography/opentype/spec/post#header
- https://googlefonts.github.io/gf-guide/requirements.html#monospace-fonts
These images below illustrate
Aring
on theoverflow: hidden
environmentBefore: Top of Aring seems clipping because miss configuration
![before-argon-bold](https://private-user-images.githubusercontent.com/38872319/333922460-1af9a51a-c6ad-4bd9-b702-68ed5d1de35b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU1OTYzOTksIm5iZiI6MTcyNTU5NjA5OSwicGF0aCI6Ii8zODg3MjMxOS8zMzM5MjI0NjAtMWFmOWE1MWEtYzZhZC00YmQ5LWI3MDItNjhlZDVkMWRlMzViLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA2VDA0MTQ1OVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWJiOTcyMjQ3OTJlMzZjMzVhNjEwN2ZhYTBkODIxZWMzYjZlZGNkOWE3ZGE1NDRhYmJhNjBhYjNiNzE3YWQ3ZWQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.8tuNxIcPZLYKZdu9os5drkMUQ294qnLMuGRLWWRRVgY)
typo/hhea
After: Resolve clipping and vertically balance basic latin
![after-argon-bold](https://private-user-images.githubusercontent.com/38872319/333922491-d227e770-4b97-494b-8a8c-6c71168f9bb9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU1OTYzOTksIm5iZiI6MTcyNTU5NjA5OSwicGF0aCI6Ii8zODg3MjMxOS8zMzM5MjI0OTEtZDIyN2U3NzAtNGI5Ny00OTRiLThhOGMtNmM3MTE2OGY5YmI5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA2VDA0MTQ1OVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWU1ZjYxMzAxNDY1NmE4NjgwZmQxNTQ2OWU2M2MzYzM0Mjc5MmE4YWNlN2M4MTdjMmE1MWEwNzE1ZGM1ZDUzMDUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.6l9eKZRDuGgo0Iwofz2_aZvgMxV7MWO0AWhOnJ9UX28)