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

Use fontations glyf/loca builder #383

Merged
merged 1 commit into from
Aug 11, 2023
Merged

Use fontations glyf/loca builder #383

merged 1 commit into from
Aug 11, 2023

Conversation

cmyr
Copy link
Member

@cmyr cmyr commented Aug 8, 2023

Based on #382


This also uses the LocaFormat type in fontations (which was copied from here) which then forces us to hack around orphan rules.

Playing around with this i have a better understanding of the annoyance we encountered previously about serializing loca. The main question this patch raised for me, was whether or not we should just have a GlyfAndLoca struct that wraps both those tables, as they're always generated together? This would let us simplify some of our serialization code.

@anthrotype
Copy link
Member

it does make sense to glue the two tables together, you always build them both at the same time, and can't read glyf without loca, and loca by itself is similarly useless

//
// FIXME: Clarify if there's a good reason not to treat glyf/loca as a single
// entity, for the purpose of persistence? like a struct that contains both
// tables, and from which the format can be retrieved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that we compute them together I think this might make more sense and might be a better change. Want to try that?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I really dislike the format wrapper; hopefully use of a single entity would let us avoid that

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea, it felt very bad writing this code. That said I think it makes sense to merge as is and open an issue, and that work can be a separate patch.

This also uses the LocaFormat type in fontations (which was copied from
here) which then forces us to hack around orphan rules.
Base automatically changed from use-fontations-glyph to main August 10, 2023 22:56
@cmyr cmyr merged commit cfd11e2 into main Aug 11, 2023
8 checks passed
@cmyr cmyr deleted the glyf-loca-builder branch August 11, 2023 15:02
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.

3 participants