Skip to content

Handle multiple glyphs after shaping in math - #6929

Merged
laurmaedje merged 8 commits into
typst:mainfrom
mkorje:math-shaping-multi-glyphs
Nov 8, 2025
Merged

laurmaedje merged 8 commits into
typst:mainfrom
mkorje:math-shaping-multi-glyphs

Conversation

@mkorje

@mkorje mkorje commented Sep 18, 2025 •

Copy link
Copy Markdown
Collaborator

Finishes #6489 (comment). In the process I also tidied up some of the shaping logic. The main change is the introduction of a ShapedText struct which is used instead of TextItem directly.

The first commit fixes #6328. I've included it here as it requires the changes made here anyways (and allows testing the subsequent changes).

Closes #7294

@isuffix isuffix left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This looks nice! Just have two comments on the first commit

Comment thread crates/typst-syntax/src/lexer.rs Resolved
Comment thread crates/typst-syntax/src/lexer.rs Resolved
@mkorje
mkorje force-pushed the math-shaping-multi-glyphs branch 2 times, most recently from 76721d2 to 6277e2b Compare October 23, 2025 04:24
@laurmaedje laurmaedje added the math Related to math category, with its syntax, layout, etc. label Oct 27, 2025

@laurmaedje laurmaedje left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does this also fix #1524? At least $ φ̅ $ seems to work. Or is the thought that we now only support whatever the shaper can do instead of going through Typst's accent layout?

Comment thread crates/typst-syntax/src/lexer.rs Resolved
Comment thread crates/typst-layout/src/math/shaping.rs Resolved
Comment thread crates/typst-layout/src/math/shaping.rs Resolved
Comment thread crates/typst-layout/src/math/shaping.rs Resolved
Comment thread crates/typst-layout/src/math/shaping.rs Resolved
@mkorje
mkorje force-pushed the math-shaping-multi-glyphs branch from 6277e2b to bc11bd4 Compare October 30, 2025 05:11
@mkorje

mkorje commented Oct 30, 2025

Copy link
Copy Markdown
Collaborator Author

Does this also fix #1524? At least $ φ̅ $ seems to work. Or is the thought that we now only support whatever the shaper can do instead of going through Typst's accent layout?

That was not intentional, though it isn't a proper fix anyways since it is using the shaper instead of the math layout for the accent placement.

@mkorje
mkorje force-pushed the math-shaping-multi-glyphs branch from 704f505 to 0caa52f Compare November 5, 2025 04:19
@laurmaedje
laurmaedje added this pull request to the merge queue Nov 8, 2025
@laurmaedje

Copy link
Copy Markdown
Member

Thank you!

Merged via the queue into typst:main with commit 64641d6 Nov 8, 2025
@mkorje
mkorje deleted the math-shaping-multi-glyphs branch November 8, 2025 11:53
ParaN3xus added a commit to ParaN3xus/tinymist that referenced this pull request Jan 16, 2026
ParaN3xus added a commit to ParaN3xus/tinymist that referenced this pull request May 15, 2026
ParaN3xus added a commit to ParaN3xus/tinymist that referenced this pull request May 24, 2026
ParaN3xus added a commit to ParaN3xus/tinymist that referenced this pull request Jun 1, 2026
Myriad-Dreamin pushed a commit to Myriad-Dreamin/tinymist that referenced this pull request Jun 13, 2026
Myriad-Dreamin pushed a commit to Myriad-Dreamin/tinymist that referenced this pull request Jun 13, 2026
Myriad-Dreamin pushed a commit to Myriad-Dreamin/tinymist that referenced this pull request Jun 13, 2026
Dikluwe pushed a commit to Dikluwe/typst-crystalline that referenced this pull request Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

math Related to math category, with its syntax, layout, etc.

Projects

None yet

3 participants