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

Better measuring of text that is in a native font rather than MathJax fonts #1014

Merged
merged 1 commit into from
Nov 20, 2023

Conversation

dpvc
Copy link
Member

@dpvc dpvc commented Nov 9, 2023

This PR fixes a problem with determining the width of text that is in a system font rather than in the MathJax fonts. These come from \text{} then mtextInheritFont is true, or from error messages (when merrorInheritFont is true, which it is by default), or from characters that aren't in the MathJax fonts, like Chinese characters, or when a font-family is specified in a \style{} command or MathML style attribute.

You can't test this in the lab, as the issue only occurs when the math is typeset outside the DOM via MathJax.tex2chtml() or one of the other conversion functions, and then inserted into a container with a font-size that is other than 100%.

@dpvc dpvc requested a review from zorkow November 9, 2023 21:40
@dpvc dpvc added this to the v4.0 milestone Nov 9, 2023
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 b27f7d8 into develop Nov 20, 2023
@dpvc dpvc deleted the utext-width branch November 20, 2023 18:05
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