Skip to content

Fix crash caused by glyph splitting #929

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 14, 2025

Conversation

arnaud-secondlayer
Copy link
Contributor

Fix a crash caused by glyph splitting ( #928 ), with a test that demonstrates the problem.
Glyph splitting assigns distinct glyphs to the same index in the original text, we need to store previously used indices to make sure we do not re-use the same index while overwriting span glyphs.

@LaurenzV
Copy link
Collaborator

LaurenzV commented Jul 3, 2025

@RazrFalcon Does that make sense to you, in case you still remember? Unfortunately I'm not at all familiar with that part of the code.

@RazrFalcon
Copy link
Collaborator

Yeah, it's hard to say. I don't know how this part should be implemented myself. But overall it should be fine.

My only suggestion would be to move HashSet out of the loop and clear it instead of creating a new one each iteration.

And put this comment directly in the code:

Glyph splitting assigns distinct glyphs to the same index in the original text, we need to store previously used indices to make sure we do not re-use the same index while overwriting span glyphs.

Otherwise, tests are passing and that's good.

@LaurenzV LaurenzV merged commit ded4b13 into linebender:main Jul 14, 2025
5 checks passed
@LaurenzV
Copy link
Collaborator

Thanks!

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