-
Notifications
You must be signed in to change notification settings - Fork 15
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
Automatic adjustment of font-size on math tag? #41
Comments
The procedure described for the MathJax feature is almost identical to the existing font-size-adjust CSS property already defined in css-text-4, except that - instead of adjusting all fonts in the font-family list to have the same x-height, you're adjusting all fonts in the font-family list to have the same x-height as the parent element's font. The sizing changes for However, I think you could probably make a reasonable case for something like |
That sounds a good idea. Probably something for @bkardell to check with the CSS people. |
Nope. Font families should not affect font sizes. You found the case where they do, but @faceless2 is right that it's terrible and we shouldn't replicate it. |
There's one tricky piece here which is: Which of the used fonts in the parent should be matched? The primary font's metrics? But what if none of the primary font's glyphs are actually used anywhere in the document? That seems like it would be wrong. Another option that could work is to recommend that content which use math set |
I think it has to be the "first available font" - we're already using this for metrics for ex/capheight etc., even if the font isn't actually used. So it would be entirely consistent to use the first-avilable font here (for anyone coming to this cold, it's defined as the the first font-face that includes U+0020 in the unicode-range). Setting it on the parent and relying on inheritance is a bit weird. In parficular, if you just want the x-height to be whatever the normal x-height for that font is, you'd have to do |
Just something to remember: we now have a |
I'm not sure what's the status of this. For the record, this is on "Other tasks" of https://mathml.igalia.com/project/ but it's not clear whether this will be in the initial implementation. @faceless2 what's the status of the discussion on the CSS WG side? |
This is a follow-up of w3c/mathml#37
With the rule
math { font-family: math; }
, the default behavior is to use a math font instead of inheriting the font from the parent that (likely) is not designed for math layout and would result in poor rendering.The font-size is inherited, but since the surrounded text and the math formula uses two different font families, the actual size of glyphs is different.
MathJax has a configuration option to try and workaround this:
https://docs.mathjax.org/en/latest/options/output/index.html#output-matchfontheight
Do we want to enhance font-size with a property value that automatically perform this kind of font-size adjustment when changing the font-family?
Or do we want to add some special adjustment for "font-family: math" (when I checked WebKit and Chromium code, it seems they do something for
font-family: monospace
but not sure whether that's specified by CSS).Or is it something that should be performed by a polyfill?
Or do we just don't care, and we should let people setup their CSS themselves?
(Note: of course, the ideal situation is when one uses a text font with its math companion, like STIX Two for the text and STIX Two Math for the math, see https://fred-wang.github.io/MathFonts/ ; this issue is about what we should do for the default)
The text was updated successfully, but these errors were encountered: