Skip to content

Fix logic in handling of an empty private points list in gvar#856

Draft
wiltse439 wants to merge 14 commits into
opentypejs:masterfrom
wiltse439:gvarfix
Draft

Fix logic in handling of an empty private points list in gvar#856
wiltse439 wants to merge 14 commits into
opentypejs:masterfrom
wiltse439:gvarfix

Conversation

@wiltse439

Copy link
Copy Markdown

There was a bug in handling gvar tuples when the private points count is set to zero.

Description

If a font defined shared points in gvar, but one of the glyphs sets the private-points flag, but has a private points length of zero, then the specification says that all points should be used. The code previously had some logic to handle this case, but it was not quite correct and we would end up using completely random values.

Motivation and Context

In the version of the Roboto font in the GitHub free fonts project, the period is defined with this value. When the weight axis exceeds 400, the logic bug would cause a dramatic distortion in the path.

How Has This Been Tested?

Using the mentioned Roboto variable font and setting the weight > 400, with a "." as text in the font inspector.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I did npm run test and all tests passed green (including code styling checks).
  • I have added tests to cover my changes.
  • My change requires a change to the documentation.
  • I have updated the README accordingly.
  • I have read the Contribute README section.

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