Repository navigation
Use extended shape information for glyph text_like-ness - #5483
Merged
Merged
Conversation
Member
|
Thanks for the deep investigation and fix! |
This was referenced Oct 10, 2025
1 task done
Dikluwe
pushed a commit
to Dikluwe/typst-crystalline
that referenced
this pull request
Sep 12, 2026
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.
Fixes #2342.
This changes how the
text_likeproperty is set for glyph and variant fragments. Instead of checking if they aren't of class "large", we use the extended shape information in the font and check if they aren't an extended shape.According to this, if the base is a single character and not an extended shape, then the baseline of the script is shifted by a font constant. Otherwise, the script is shifted above/below the base by a font constant. I've retained the behaviour introduced in #4545, where sequences of text-like stuff use the constant script shift. Thus the current Typst behaviour now sits somewhere between TeX engines (which don't use extended shape information at all) and Microsoft's implementation (which follows the algorithm from above). I think this is a fine state to be in, given we find the behaviour in #4545 desirable. Also, the continued use of the
text_likeproperty, introduced in #3059 (which superseded #1129), lets us preserve it throughaccent,cancel, andopelements.