Set glyph width to 0 if the glyph class is "mark"#299
Set glyph width to 0 if the glyph class is "mark"#299jenskutilek wants to merge 1 commit intolatex3:devfrom
Conversation
What is this requirement based on? Having a non-zero advance width for mark glyphs sounds like a font bug to me. |
|
This requirement is not spelled out explicitly anywhere, but can be deduced from the TrueType and OpenType spec, and testing in different environments that use monospaced fonts. Per Apple’s original TrueType spec, the first glyphs in a font must be
Per the current OpenType spec recommendations for the hhea and hmtx tables, "It is suggested that monospaced fonts set numberOfHMetrics to three". This also follows the Apple spec. The first HMetrics entry will be the width of the It's not possible to build a font with 3 HMetrics entries if the combining diacritics have an advance width of 0, as in that case there must be HMetrics entries for all glyphs (up to the last glyph in the font after which the advance width stays the same). Bugs for various environments have been reported that state if all encoded Glyphs are not monospaced:
|
|
Here are two versions of my Sudo coding font. The only difference in the one called SudoNM is that the glyph |
|
This issue desperately needs clarification in the OpenType specification. |
In monospaced fonts, all glyphs must have the same width, including mark glyphs. In proportionally spaced fonts, those usually have a width of 0.
luaotfload currently reads the actual width for mark glyphs from the font. This results in an extra space after the mark glyph, as you can reproduce with the Sudo Coding Font:
This has been discovered and discussed in the Glyphs forum.
This PR sets the width of mark glyphs to 0, regardless of their width in the font. The result: