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

should make 'space' the second glyph gid1 unless glyphOrder explicitly says otherwise #1042

Closed
anthrotype opened this issue Oct 16, 2024 · 4 comments
Milestone

Comments

@anthrotype
Copy link
Member

TIL Glyphs.app always place the 'space' glyph after .notdef, even when the glyphOrder custom parameter says something else, unless you really really tell it to stop with yet another custom parameter which I cannot even find:

https://forum.glyphsapp.com/t/custom-glyphorder-is-not-respected/31555

Ufo2ft also just added something similar: if public.glyphOrder is absent or if it does not list the 'space' glyph while it is present in the font, it will make it so it is placed second after the .notdef:

issue: googlefonts/ufo2ft#880
PR: googlefonts/ufo2ft#881

All this apparently is because some old Windows wants gid1 to be a blank glyph because of some implementation detail while rendering COLRv0 fonts, or else it will overlay the colored glyphs on top of the non-empty gid1 contours.

I suppose we'll need to make sure both our glyphs2fontir and ufo2fontir frontends also behave accordingly, in order to match updated fontmake.

@anthrotype
Copy link
Member Author

anthrotype commented Nov 5, 2024

As of https://github.com/googlefonts/glyphsLib/releases/tag/v6.9.3 released 4 days ago, glyphsLib will also place the 'space' glyph as gid1 after the '.notdef' unless yet another "Keep GlyphOrder" custom parameter is set to true.
Although, I don't seem to be even able to set that parameter yet using the latest Glyphs.app beta 3.3 build 3324.
Probably it hasn't even shipped, not sure: https://forum.glyphsapp.com/t/custom-glyphorder-is-not-respected/31555/12

So to recap: ufo2ft checks for public.glyphOrder in the DS/UFO lib, if that is set it will use the glyph order at face value and will not do any reordering besides the required .notdef as gid0 (which fontc already supports); if public.glyphOrder is not specified, ufo2ft will place space after .notdef (this change is only in main and hasn't cut a release yet).

Whereas, glyphsLib >= 6.9.3 when exportig .glyphs to master UFOs will now set the UFO's public.glyphOrder such that space is always placed second after the .notdef, even if there is a glyphOrder custom parameter that says otherwise. In order to ensure glyphsLib actually obeys the stated glyphOrder one also needs to add the other "Keep GlyphOrder" custom parameter.

I expect none of the GF projects that fontc_crater runs against contain this new obscure parameter, so all the ones that didn't bother setting an explicit glyphOrder custom parameter with [.notdef, space] as the first two glyphs, will suddenly show a diff in the GlyphOrder pseudo-table in the ttx_diff.py. A different glyph order may also produce other spurious diffs in other tables which sort things by the glyph order.

@anthrotype anthrotype added this to the fontc 1.0 milestone Nov 5, 2024
@anthrotype
Copy link
Member Author

anthrotype commented Nov 8, 2024

I actually decided to revert those changes in glyphsLib and ufo2ft, I don't think there is anything to do for fontc. Maybe when we gain the ability to build COLRv0, we could issue a warning in case gid1 is not blank saying this used to be required in some old Windows COLRv0 implementation. The font developer can then decide to set an explicit glyphOrder to place an empty glyph at index 1.

@rsheeter
Copy link
Contributor

I don't think there is anything to do for fontc

Can we close this then?

@anthrotype
Copy link
Member Author

Yes

@anthrotype anthrotype closed this as not planned Won't fix, can't repro, duplicate, stale Nov 14, 2024
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