Fix several issues with multi-character stretchy assemblies. (mathjax/MathJax#3528, mathjax/MathJax#3531)#1441
Open
Fix several issues with multi-character stretchy assemblies. (mathjax/MathJax#3528, mathjax/MathJax#3531)#1441
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1441 +/- ##
===========================================
- Coverage 86.49% 86.45% -0.05%
===========================================
Files 340 340
Lines 86044 86092 +48
Branches 4833 4833
===========================================
+ Hits 74425 74431 +6
- Misses 11595 11661 +66
+ Partials 24 0 -24 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
This PR fixes several issues with multi-character stretchy assemblies. There were two main problems:
The first is fixed in the
ts/output/chtml/FontData.tsfile by reducing theline-heightby a small fuzz factor. The SVG output was using this, and the value for that (and a horizontal fuzz factor) have been moved to the common FontData.ts file so they can be used by both output formats.The positioning of the extender is also fixed so that the overlap with the upper glyph is more consistent.
The horizontal extenders in CHTML now uses the
HFUZZvalue to add a little overlap as well, since glyphs with rounded ends were producing some gaps.The second issue is addressed in the
ts/output/chtml/Wrappers/mo.tsfile. It now uses the namedVFUZZandHFUZZvalues, but the main change is in thecreatePart()method, which checks if the requested height is less than the sum of the top and bottom parts (W < 0) in a vertical assembly (nlis not null), and if so, it overrides the top and bottom margins, which are what reserve the space for the top and bottom glyphs, to make the total height be correct. ThecreateAssembly()function is adjusted to add the needed heights to the data that is passed tocreatePart()The
ts/output/svg/Wrapers/mo.tsfile is modified to remove theprettier-ignorecomment, and allowing the function to be prettified. That is really the only change, other than moving the definitions of the fuzz values to the commonFontData.tsfile.Resolves issues mathjax/MathJax#3528 and mathjax/MathJax#3531.