Prune unused regions from HVAR and VVAR when using a direct mapping #3797
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This saves a handful of bytes for the common case where a font is variable but has no variation in its advances (e.g. for some monospace fonts across
wght
), and we include an empty metrics variation table so that the shaper can immediately ascertain this without interpolating phantom points.e.g. a direct mapping is now preferred for the font in the included test case, shrinking the table from 47 to 42 bytes
This optimisation is mostly relevant as it brings fontTools in line with fontc's compilation of direct mappings (see googlefonts/fontc#1388).
This area of the API is a bit new to me though - would someone be willing to confirm that I am holding the
prune_regions()
function correctly?Note: this is a personal contribution independent of my employer, and so I've submitted from a fork under my personal profile and email to make this distinction