Open
Conversation
`skrifa` will ignore the variation coordinates if they are all default values. This broke the caching because the coordinates from the skrifa `HintingInstance` were used to compare the cache key. This commit stores copies of the `size` and `coords` in the cache entry instead of retrieving them from the `HintingInstance`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
skrifawill ignore the variation coordinates if they are all default values (googlefonts/fontations#1423). This broke the hinting cache because the coordinates from the skrifaHintingInstancewere used to compare the cache key.This PR stores copies of the
sizeandcoordsin the cache entry instead of retrieving them from theHintingInstance.Alternative: Could re-implement the
effective_coordsfunction (https://github.com/googlefonts/fontations/blob/d677a6bee28027a5d474bef20e0e6d156f7538a2/skrifa/src/instance.rs#L121-L127) and use those coords for the comparison, but any other changes to thesizeorcoordsof theHintingInstancewould break the caching again, so I feel this is more robust.Notably,
cosmic-textwill always include a default weight if the font supports it (since pop-os/cosmic-text#400) and will currently rebuild the hinting for every rasterized glyph due to this bug. This adds ~100µs per glyph for Roboto on my machine.