Skip to content
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

[com.google.fonts/check/valid_glyphnames] -- Update check to reflect the current spec #2832

Closed
eliheuer opened this issue Apr 15, 2020 · 0 comments
Assignees
Milestone

Comments

@eliheuer
Copy link
Collaborator

eliheuer commented Apr 15, 2020

The rationale for this check reads as follows:

Microsoft's recommendations for OpenType Fonts states the following:

'NOTE: The PostScript glyph name must be no longer than 31 characters, include only uppercase or lowercase English letters, European digits, the period or the underscore, i.e. from the set [A-Za-z0-9_.] and should start with a letter, except the special glyph name ".notdef" which starts with a period.'

https://docs.microsoft.com/en-us/typography/opentype/spec/recom#post-table

I want to suggest that this check and the rationale doesn't fully reflect the current state of the Microsoft and Adobe spec. I think the character limit for a FAIL should be increased to 63, and the character limit of 31 should be downgraded to a WARN.

The 31 character limit is usually too small for most Arabic fonts, and it's difficult to rename characters in Glyphs source files when building with Fontmake because Glyphs assumes you will use it's own build system, and the suggested way to rename glyphs is with a custom XML file that only exists as part of the Glyphs application.

For reference, the Cairo pull request is currently failing this check for two names, both of which are under 63 character long. As far as I can tell there is no easy way to shorten these names without losing consistency with the other names in the font.

alefMaksura_alefMaksuraar.fina.alt
yehHamzaabove_yehHamzaabovear.fina

The Rationale simply states that The PostScript glyph name must be no longer than 31 characters, but looking at the link to the Microsoft spec it looks like this isn't completely true. The Microsoft spec states the following:

Glyph names must be assigned as described in the Adobe Glyph List Specification, which specifies glyph naming conventions for all Unicode characters as well as those that don’t have standard Unicode values such as certain ligatures or glyphic variants.

Looking at the Adobe Glyph List Specification, It appears the note in the Microsoft spec about the 31 character limit is out of date. I will file an issue with the Microsoft spec after posting this issue.

Looking at the changelog for the Adobe spec, I see this from Ken Lunde:

Version 2.8 (August 9, 2018) The length-limit of glyph names was adjusted from 31 to 63 characters to reflect current practices and implementations, along with a note that some older implementations may impose a 31-character limit.

I sugest someone should look over the Adobe spec before merging a PR fixing this, but here is the relevant information:

...in practice, particularly in modern environments, glyph names can be as long as 63 characters...

All glyph names are subject to a length-limit of 63 characters, and require that they be entirely composed of characters from the following set: A–Z, a–z, 0–9, ‘.’ (period; U+002E FULL STOP), and ‘_’ (underscore; U+005F LOW LINE). Some older implementations may impose a length-limit of 31 characters.

Looking at this issue, it appears Adobe has been interested in downgrading this to a warn for their own use: #2602

@eliheuer eliheuer assigned eliheuer and felipesanches and unassigned eliheuer Apr 15, 2020
@felipesanches felipesanches added this to the 0.7.23 milestone Apr 15, 2020
felipesanches added a commit to felipesanches/fontbakery that referenced this issue Apr 15, 2020
com.google.fonts/check/valid_glyphnames
(issue fonttools#2832)
felipesanches added a commit to felipesanches/fontbakery that referenced this issue Apr 15, 2020
com.google.fonts/check/valid_glyphnames
(issue fonttools#2832)
felipesanches added a commit to felipesanches/fontbakery that referenced this issue Apr 15, 2020
com.google.fonts/check/valid_glyphnames
(issue fonttools#2832)
felipesanches added a commit to felipesanches/fontbakery that referenced this issue Apr 15, 2020
com.google.fonts/check/valid_glyphnames
(issue fonttools#2832)
felipesanches added a commit that referenced this issue Apr 15, 2020
com.google.fonts/check/valid_glyphnames
(issue #2832)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants