-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Collapsed font heights #3127
Comments
Yes, this is by design. The MathJax fonts are intended for use within MathJax for laying out mathematics, and are not designed for use as text fonts. The reason for this unusual ascent/descent setup is so that when used with line-height equal to 0 (as in MathJax's layout), the fonts align on their baselines. This is achieved by having their ascent and descent being equal. Ideally, both would have been zero, but some browsers had trouble with that, so they have a small ascent and descent. This makes it easier to place the characters in a two-dimensional layout, for things like superscripts and subscript, accents, limits on summations, fractions, etc. MathJax also needs to make each character have its correct height and depth rather than the height and depth of the font as a whole, and so CSS padding is used to set the height and depth (and width) from the baseline, which is easiest to do when the ascent and decent are zero, as is the case with line-height of zero when the ascent and decent are equal. The fonts in v4 handle this in a different way, but in v3 the fonts were set to have equal ascent and decent. |
How specifically will this change in v4? I already read about the switch to Latin Modern in mathjax/MathJax-src#973. |
The fonts all have their natural ascent and descent values, except for one that is used to force the ascent/descent to be equal when it is used as the first font in a list of fonts in |
When playing around with the MathJax fonts found in
ts/output/chtml/fonts/tex-woff-v2
, I noticed that the height of the text that this font produces is collapsed, i.e. it doesn't have the full height.Example:
These are just two
<div>
s with the texts "01234567890" and "xyz" andMathJax_Main-Regular.woff
andMathJax_Main-Italic.woff
, with no further modifications other than theirfont-size
scaled up.Was this a conscious decision? If so, what's the motivation behind it?
The text was updated successfully, but these errors were encountered: