W3C home > Mailing lists > Public > public-css-archive@w3.org > August 2020

Re: [csswg-drafts] [css-fonts-4] Managing the scaling of font-size within MathML rendering (#5389)

From: Frédéric Wang via GitHub <sysbot+gh@w3.org>
Date: Sun, 23 Aug 2020 12:44:22 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-678769925-1598186661-sysbot+gh@w3.org>
@faceless2: Merging the scriptlevel property into font-size is known to cause these issues, it is not clear how to address them. This change was a tradeoff between the need of MathML and what integrates better into CSS, so let's see what the WG people say.

The point I'm currently more concerned about after this merge is that fantasai said introducing an "internal property" like we implemented in chromium is a bad idea. However, I still don't know how to make this work for absolute changes of scriptlevel otherwise (incidentally this is not needed for relative changes, which are the only ones required in the default UA sheet). I already asked her by email so we'll wait for her explanation before commenting further.

In any case my two cents: 

- Setting "math { font-size: scriptlevel(0) }" will scale up the font-size if the internal scriptlevel had been increased on ancestors (a different example from yours: a document with nested math tags). On the other hand, not setting it will make absolute changes like scriptlevel="0" wrong in this case. So I don't know whether there is a clear choice. But I also don't think these use cases are super important. Actually, I think the original proposal also had the same issue and was incorrectly trying to working around that via the "initial" value, see https://github.com/mathml-refresh/mathml/issues/154#issuecomment-607100375

- Resetting scriptlevel to 0 after font-size is also not perfect e.g. `<math><mstyle scriptlevel="+1"><mstyle style="font-size: 16px"><mstyle scriptlevel="3"`,  the third mstyle would scale down font-size by 0.71^3 instead of 0.71^2 according to MathML3. That said, when someone modifies the font-size within a math expression, the rendering will certainly look wrong in any case with a formula having inconsistent size of subexpressions, so I'm not sure we need to worry about the consequences (what happens with absolute scriptlevel, or scriptlevel and font-size set simultaneously on an element) or whether there is a strong preference.  I think the only important case is when someone modifies the font-size on the math root... not sure why you have documents modifying the font-size on a `<mtable>`, probably in "normal" use cases, tables would either set to displaystyle="true" or just let potential automatic font-size increase happen.

-- 
GitHub Notification of comment by fred-wang
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5389#issuecomment-678769925 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Sunday, 23 August 2020 12:44:24 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:13 UTC