Add check to ensure a base glyph isn't classified as a mark glyph in GDEF table
See original GitHub issueWe pushed Hebo VF to production yesterday and a user reported that the comma and underscore are not working as intended, https://github.com/google/fonts/issues/2453.
When I inspect the GDEF table, we can see that the “comma” is a class 3 aka a “Mark” glyph, https://docs.microsoft.com/en-us/typography/opentype/spec/gdef#glyph-class-definition-table
(venv) Marcs-Air:heebo marcfoley$ grep "comma" Heebo\[wght\].ttx
<ClassDef glyph="comma" class="3"/>
When I inspect the source files, we can see a mark anchor exists in the comma.
An _ denotes that this glyph is a mark glyph
To ensure that base glyphs are not classified as a mark glyph, we could raise a fail If a glyph has an advance width greater than 0 and it exists in the gdef.GlyphClassDef
as class 3.
More than happy to submit a pr.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
GDEF — Glyph Definition Table (OpenType 1.9) - Typography
The Glyph Class Definition (GlyphClassDef) table identifies four types of glyphs in a font: base glyphs, ligature glyphs, combining mark ...
Read more >Glyphs 3 Handbook
Glyphs can automatically build the 'mark' (Mark to Base) feature using anchors. ... If this approach does not work, check Test Install in...
Read more >Tables panel - FontLab VI Help
By default, FontLab will not import the tables listed in the Preferences > Open Fonts > Do not import these tables to Tables...
Read more >OpenType Feature File Specification | afdko - GitHub Pages
Note: The feature file glyph classes described in this section are not to be ... mark glyphs are specified in the glyph class...
Read more >Glyphs and special characters - Adobe Support
The character appears at the text insertion point. Insert a recently used glyph. InDesign tracks the previous 35 distinct ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
yes, that could be a signal that something is not ok, either the GDEF classifies a base glyph incorrectly as a mark, or a glyph that is supposed to be used as a mark has an incorrect advance width that should have been 0.
Note that in glyphsLib we automatically set the advance width to 0 for glyphs that are classified as nonspacing marks (via GlyphData.xml or custom glyph properties).
Technically one does not need to set width to 0 because OT layout engines would automatically do when if a glyph is classified as mark.
IMO it would be better to recommend that the sources contain an explicit GDEF table definition in the UFO/features.fea (this is created automatically by fontmake for .glyphs sources using GlyphData.xml database in glyphsLib). When there is an explicit GDEF definition in the features.fea, ufo2ft does not guesses whether a glyph is a mark by the presence of an
_
-prefixed anchor, but instead it uses the GDEF to classify glyphs as bases, marks and ligatures accordingly.