Skip to content

sparse_strips: Apply stroke adjustment#1576

Merged
LaurenzV merged 1 commit into
mainfrom
laurenz/adjust_stroke
Apr 15, 2026
Merged

sparse_strips: Apply stroke adjustment#1576
LaurenzV merged 1 commit into
mainfrom
laurenz/adjust_stroke

Conversation

@LaurenzV
Copy link
Copy Markdown
Collaborator

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.

@LaurenzV LaurenzV requested a review from taj-p April 14, 2026 14:20
@laurenz-canva laurenz-canva force-pushed the laurenz/adjust_stroke branch from d0b591d to 664e22e Compare April 14, 2026 14:25
Copy link
Copy Markdown
Contributor

@taj-p taj-p left a comment

Choose a reason for hiding this comment

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

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.

@LaurenzV LaurenzV added this pull request to the merge queue Apr 15, 2026
Merged via the queue into main with commit 36e06ab Apr 15, 2026
17 checks passed
@LaurenzV LaurenzV deleted the laurenz/adjust_stroke branch April 15, 2026 06:22
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.

3 participants