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

[write-fonts] Match fonttools sorting in var store #671

Merged
merged 2 commits into from
Oct 24, 2023
Merged

Conversation

cmyr
Copy link
Member

@cmyr cmyr commented Oct 23, 2023

With this patch we will use a consistent ordering to sort both encodings (which correspond to outer indices, in a VariationIndex table) and individual delta sets (which correspond to inner indices.)

This PR is more complicated than expected because we had to jump through some hoops in order to precisely match the sorting behaviour in fonttools.

With this, googlefonts/fontc#490 now produces identical output for HVAR.

With this patch we will use a consistent ordering to sort both encodings
(which correspond to outer indices, in a VariationIndex table) and individual
delta sets (which correspond to inner indices.)

This PR is more complicated than expected because we had to jump through
some hoops in order to precisely match the sorting behaviour in
fonttools.
@cmyr cmyr force-pushed the delta-set-sort-order branch from 615678b to 36e4f88 Compare October 23, 2023 21:36
@cmyr cmyr force-pushed the delta-set-sort-order branch from 322caba to 72f7985 Compare October 24, 2023 15:23
@behdad
Copy link
Contributor

behdad commented Oct 24, 2023

LGTM. Thanks!

This is a bit funny because of how fonttools represents the
rowshape/characteristic, which is a packed delta with the first rows in
the lowset bits.

Testing is a bit ad-hoc, and is based around comparing to the current
fonttools behaviour.
@cmyr cmyr force-pushed the delta-set-sort-order branch from 72f7985 to 8587eaf Compare October 24, 2023 19:22
@cmyr cmyr merged commit 77ab3e6 into main Oct 24, 2023
6 checks passed
@cmyr cmyr deleted the delta-set-sort-order branch October 24, 2023 19:25
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