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] Fix miscalculation of ppf2 subgraph size #610

Merged
merged 1 commit into from
Sep 13, 2023

Conversation

cmyr
Copy link
Member

@cmyr cmyr commented Sep 12, 2023

I had run into a probley friday afternoon that I didn't have time to dig into, and I didn't want to block on getting fontc working again. This fixes that.

It turns out were incrementing the current index only when the subtable had not been seen before, which meant we would never advance the index and would not visit all subtables.

// let's have single class1class, and three class2 classes
// we want a duplicate varidx, a null varidx, and a device table?

fn make_val_record(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Optional, this would be easier to read hoisted out like make_class_def.

It's also hard to tell what the args are in the code. What if it took only the advance so this:

                make_val_record(5, None),
                make_val_record(6, DeviceOrVariationIndex::variation_index(4, 20)),

read more like this:

                val_with_xadvance(5),
                val_with_xadvance(6).with_x_advance_device(DeviceOrVariationIndex::variation_index(4, 20)),

make_class_def is similar, what's a class def 3,3,1?!

Copy link
Member Author

@cmyr cmyr Sep 13, 2023

Choose a reason for hiding this comment

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

This is defined inline since it's only used in this one test, whereas make_class_def is shared. :)

Copy link
Collaborator

@rsheeter rsheeter left a comment

Choose a reason for hiding this comment

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

LGTM subject to comments being addressed

I had run into a problem here that I didn't have time to dig into last
week.

It turns out were incrementing the current index only when the subtable had
not been seen before, which meant we would never advance the index and would
not visit all subtables.
@cmyr cmyr force-pushed the fix-ppf2-device-size branch from 9dcf366 to b7a2d28 Compare September 13, 2023 15:41
@cmyr cmyr merged commit d6d0e13 into main Sep 13, 2023
9 checks passed
@cmyr cmyr deleted the fix-ppf2-device-size branch September 13, 2023 16:55
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