sparse_strips: Apply stroke adjustment#1576
Merged
Merged
Conversation
d0b591d to
664e22e
Compare
taj-p
approved these changes
Apr 14, 2026
Contributor
taj-p
left a comment
There was a problem hiding this comment.
Unfortunately, this is not straightforward to do, because at the time where we do absorption, we don't know yet whether we are going to fill or stroke. So this is the only hack I could come up with.
Seems like a deficiency in the API.
LGTM for now but this certainly provides important context for how this API needs to evolve.
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.
If we have a glyph run with font size 8 and a scaling factor of 8, we instead set the font size to 64 and the scale to 1. However, the stroke width should still be affected by the scaling factor, even if we absorb. Unfortunately, this is not straightforward to do, because at the time where we do absorption, we don't know yet whether we are going to fill or stroke. So this is the only hack I could come up with.
There is one uncertainty: For glyph caching, we only do absorption if there is no skewing and uniform scaling, so this is always safe to do. However, for hinting we also can absorb if there is vertical skewing; I'm not sure if uniformly increasing the stroke width is still the right thing to do here? But anyway, this is hopefully an edge case we can ignore for now.