Open fred-wang opened 8 months ago
Tentative test: unfortunately, scripts-spaceafterscript3000.woff cannot be access due to CORS policy. It seems chromium badly computes the inline size of mmultitscripts BTW.
<!DOCTYPE html>
<style>
math {
font: 50px spaceafterscript3000;
}
mspace {
background: black
}
mmultiscripts {
background: gray;
}
@font-face {
font-family: spaceafterscript3000;
src: url("http://wpt.live/fonts/math/scripts-spaceafterscript3000.woff");
}
</style>
<math>
<mmultiscripts>
<mspace width="1em" height="1em" depth="1em"/>
<mspace width="1em" height="1em" depth="1em"/>
<mspace width="2em" height="1em" depth="1em"/>
<mspace width="3em" height="1em" depth="1em"/>
<mspace width="4em" height="1em" depth="1em"/>
<mprescripts/>
<mspace width="1em" height="1em" depth="1em"/>
<mspace width="2em" height="1em" depth="1em"/>
<mspace width="3em" height="1em" depth="1em"/>
<mspace width="4em" height="1em" depth="1em"/>
</mmultiscripts>
</math>
I would tend to lean towards symmetry. Do you have any idea what TeX does for the equivalent {}_{sub}_{sup}{base}_{sub}_{sup}
?
I'm not completely sure that is right comparison though. The mhchem package for ${}^{238}\text{U}$ does a lot of tweaking for spacing, so maybe that is a better indicator of what is right. It's a mess though:
<math>
<mrow>
<msubsup>
<mrow>
<mrow>
<mpadded width='0'>
<mphantom>
<mi>A</mi>
</mphantom>
</mpadded>
</mrow>
</mrow>
<mrow>
<mrow>
<mpadded height='0' depth='0'>
<mphantom></mphantom>
</mpadded>
</mrow>
</mrow>
<mrow>
<mrow>
<mpadded height='0' depth='0'>
<mphantom>
<mn>238</mn>
</mphantom>
</mpadded>
</mrow>
</mrow>
</msubsup>
<mspace width='-0.083em' linebreak='nobreak'></mspace>
<msubsup>
<mrow>
<mrow>
<mpadded width='0'>
<mphantom>
<mi>A</mi>
</mphantom>
</mpadded>
</mrow>
</mrow>
<mrow>
<mrow>
<mpadded width='0'>
<mphantom>
<mn>2</mn>
</mphantom>
</mpadded>
</mrow>
<mrow>
<mpadded width='0' lspace='-1width'>
<mrow>
<mpadded height='0'></mpadded>
</mrow>
</mpadded>
</mrow>
</mrow>
<mrow>
<mrow>
<mpadded height='0'>
<mrow>
<mpadded width='0'>
<mphantom>
<mn>2</mn>
</mphantom>
</mpadded>
</mrow>
</mpadded>
</mrow>
<mrow>
<mpadded width='0' lspace='-1width'>
<mn>238</mn>
</mpadded>
</mrow>
</mrow>
</msubsup>
<mrow>
<mi mathvariant='normal'>U</mi>
</mrow>
</mrow>
</math>
So the former option makes the rendering more symmetric with respect to the base, but the latter makes it more consistent with the parameter name.
I guess one can view the symmetric approach to have a reading of "After" that means "AwayFromBase", or "Outer". "After" is a bit of an unfortunate preposition, since it depends on an implied traversal order...
I stumbled on some interop issue while exporting tests from Gecko.
For the record this is the == reftest (note: this is using RTL mmultiscript): http://wpt.live/mathml/presentation-markup/direction/direction-overall-003.html http://wpt.live/mathml/presentation-markup/direction/direction-overall-003-ref.html
The results are not available yet, but they should appear at: https://wpt.fyi/results/mathml/presentation-markup/direction/direction-overall-003.html?label=experimental&label=master&aligned
I tested with MS Word, and spaceAfterScript is added before prescripts (the test font uses a large value to make it obvious):
I submitted https://github.com/MicrosoftDocs/typography-issues/issues/1135 for clarifying this in OpenType spec.
I tested with MS Word, and spaceAfterScript is added before prescripts (the test font uses a large value to make it obvious):
Thanks Khaled, so this would consistent with MathML Core / Chromium. What is your test? It seems there is only one prescript and presubscript, right? Because I only see one gap.
It seems there is only one prescript and presubscript, right?
Yes. Perhaps this screenshot makes it more obvious:
OK, I was asking because MathML supports multiple sub/sup pairs of prescripts, so we have a more generic use of spaceAfterScript: https://w3c.github.io/mathml-core/#figure-box-mmultiscripts
I don’t think Microsoft Word support multiple pairs on either side.
@khaledhosny So IIUC the conclusion is that the space should be added before pre-scripts (and after post-scripts) so the "symmetric" approach by Chromium, not the "always-after-scripts" approach by Firefox.
Yes. The spec text was also updated to make this more explicit:
Extra white space to be added after each subscript and superscript that occurs after a baseline element, and before each subscript and superscript that occurs before a baseline element.
I stumbled on some interop issue while exporting tests from Gecko.
From https://learn.microsoft.com/en-us/typography/opentype/spec/math:
MathML Core and Chromium places the space before each prescript at https://w3c.github.io/mathml-core/#base-with-prescripts-and-postscripts:
But Firefox seems to do it the other way around, i.e. place the space after each prescript.
So the former option makes the rendering more symmetric with respect to the base, but the latter makes it more consistent with the parameter name.
Since we have space between scripts anyway, the significant difference is that the former adds a space between the leftmost scripts (assuming LTR) and the content before ; and the latter adds a space between the base and its closest prescripts.