Skip to content
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

Fix handling of unknown characters in SVG output. (mathjax/MathJax#3224) #1089

Merged
merged 1 commit into from
Jun 4, 2024

Conversation

dpvc
Copy link
Member

@dpvc dpvc commented May 3, 2024

This PR fixes an issue with the handling of the width of characters that are not in the MathJax fonts in SVG mode that could lead to overlapping characters. The SVG wrapper's toSVG() code has been reordered to make this work properly. The handling of unknown characters has been moved to the top, and if-then-else has been broken into separate if-then with returns, with the width of previous unknown characters being taken properly into account (which was what wasn't being done).

This only affects text that is all in the same MathML node, so you can test using \text{aaa 中文 bbbb} for the unknown and p sections of the code. To get a c test, you need to use the mathjax-tex font with \text{aaa\U{220C}bbb}.

Resolves issue mathjax/MathJax#3224.

@dpvc dpvc requested a review from zorkow May 3, 2024 13:41
@dpvc dpvc added this to the v4.0 milestone May 3, 2024
Copy link
Member

@zorkow zorkow left a comment

Choose a reason for hiding this comment

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

lgtm.

@dpvc dpvc merged commit d6a9ee6 into develop Jun 4, 2024
@dpvc dpvc deleted the issue3224 branch June 4, 2024 16:08
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.

None yet

2 participants