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

Highly sophisticated notdef glyph #379

Merged
merged 1 commit into from
Feb 18, 2022
Merged

Highly sophisticated notdef glyph #379

merged 1 commit into from
Feb 18, 2022

Conversation

rsheeter
Copy link
Collaborator

@rsheeter rsheeter commented Feb 8, 2022

A font without a glyph data table fails OTS. A font with no glyphs with outlines emits a 1 byte glyf table but will emerge from woff2 with a 0 byte glyf. Provide a definition of notdef to avoid getting into this situation.

Currently I've only done this when we're actually generating glyf but I suspect even when there is no glyf or cff table (say a pure SVG font) we might want to add something to increase the odds things Just Work.

@anthrotype
Copy link
Member

Currently I've only done this when we're actually generating glyf but I suspect even when there is no glyf or cff table (say a pure SVG font) we might want to add something to increase the odds things Just Work.

We always add an empty table when color format is picosvg or untouchedsvg (glyf or CFF, depending on the file extension suffix of the --output_file flag is respectively .ttf or .otf), the table is never actually missing, it's empty but it's there.

I see you draw the notdef glyph only inside _colr_ufo method if format starts with glyf, which means it only gets drawn for glyf-flavored COLR v0 or v1 format. But my understanding was that the issue with OTS complaining about empty outline table was to do with OT-SVG font inside FireFox..
I'd expect that the notdef drawing method be moved to where we actually create our temporary UFO (inside _ufo method), regardless of the color/output format, be it COLR, SVG, glyf or CFF.

@anthrotype
Copy link
Member

+1 if we allow user to draw their own .notdef glyph, we would special case it in the list of input SVGs and use that one if present, or fall back to draw one if missing

@rsheeter rsheeter changed the title [DRAFT] Highly sophisticated notdef glyph Highly sophisticated notdef glyph Feb 14, 2022
@rsheeter
Copy link
Collaborator Author

rsheeter commented Feb 14, 2022

notdef drawing method be moved to where we actually create our temporary UFO

Good catch, fixed. You can still achieve OTS failure by subsetting and dropping the notdef outline but who would do such a thing!

src/nanoemoji/write_font.py Show resolved Hide resolved
@anthrotype anthrotype merged commit a9f6b14 into main Feb 18, 2022
@anthrotype anthrotype deleted the notdef branch February 18, 2022 18:06
anthrotype added a commit to googlefonts/noto-emoji that referenced this pull request Feb 22, 2022
The only change is the .notdef glyph now has an outline thanks to googlefonts/nanoemoji#379
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants