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

Add GlyfLocaBuilder #559

Merged
merged 1 commit into from
Aug 4, 2023
Merged

Add GlyfLocaBuilder #559

merged 1 commit into from
Aug 4, 2023

Conversation

cmyr
Copy link
Member

@cmyr cmyr commented Aug 3, 2023

This attempts to be a nice ergonomic way to build the glyf & loca tables.

Based on #558.

I have a few questions about this, and the fontc impl (maybe @anthrotype can answer these?)

  • I've added special logic here so that if a glyph contains no outline/contour, we write no data for that glyph, but still add a (zero-length) entry to the loca table. I was looking at fontc's current impl, and it doesn't seem to do this? I assume it is an oversight there, but I'd love someone to double-check my work.
  • Additionally the spec says that the first glyph is always the placeholder/notdef glyph. Should we be enforcing this somehow, or is it up to the caller? It feels like it has to be up to the caller, since we don't really have the relevant information...

Base automatically changed from glyf-loca-improvements to main August 3, 2023 18:16
This attempts to be a nice ergonomic way to build the glyf & loca
tables.
@cmyr cmyr marked this pull request as ready for review August 3, 2023 18:20
@anthrotype
Copy link
Member

if a glyph contains no outline/contour, we write no data for that glyph, but still add a (zero-length) entry to the loca table

yeah empty glyphs contain no glyf data, so their location is the same as the preceding glyph

I was looking at fontc's current impl, and it doesn't seem to do this?

well, what does it do differently?

enforcing .notdef... up to the caller?

yeah, sounds good to me

@cmyr
Copy link
Member Author

cmyr commented Aug 4, 2023

In fontc, currently, if a glyph contains no outlines we still write the header.

@cmyr cmyr merged commit 55845ab into main Aug 4, 2023
7 checks passed
@cmyr cmyr deleted the glyf-loca-builder branch August 4, 2023 18:07
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.

2 participants