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 86106 +62
Branches 4833 4834 +1
===========================================
+ Hits 74425 74439 +14
- Misses 11595 11643 +48
Partials 24 24 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
zorkow
left a comment
There was a problem hiding this comment.
There is one formatting issue wrt. the comment alignment.
Otherwise fine.
| B: number, | ||
| W: number | ||
| ) { | ||
| if (!n) return; |
There was a problem hiding this comment.
Add // prettier-ignore-start here
ts/output/svg/Wrappers/mo.ts
Outdated
| const s = (1.5 * Y) / (h + d); // // Scale height by 1.5 to avoid bad ends | ||
| // // (glyphs with rounded or anti-aliased ends don't stretch well, | ||
| // // so this makes for sharper ends) | ||
| const y = (s * (h - d) - Y) / 2; // // The bottom point to clip the extender |
There was a problem hiding this comment.
Add // prettier-ignore-end here.
| * @param {number} B The height of the bottom glyph in the delimiter | ||
| * @param {number} W The width of the stretched delimiter | ||
| */ | ||
| /* prettier-ignore */ |
There was a problem hiding this comment.
prettier-ignore here was probably a bit overkill at the time. But I don't like the double use of // either.
We should just use prettier-ignore-start|end instead. See below.
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.