226 views

Skip to first unread message

Apr 10, 2024, 4:51:53 AMApr 10

to dev-pl...@mozilla.org

As of 2024-04-10, I intend to remove automatic vertical centering of

some basic binary operators for MathML. This was never implemented in

other browsers and is not described in any specification.

Bug to remove: https://bugzilla.mozilla.org/show_bug.cgi?id=1890531

To understand better, here is a basic example:

<!DOCTYPE html>

<link

rel="stylesheet"

href="https://fred-wang.github.io/MathFonts/STIX/mathfonts.css" />

<math style="font: 20pt 'STIX Two Math'">

<mfrac>

<mn>12</mn>

<mn>34</mn>

</mfrac>

<mo>+</mo>

<mn>56</mn>

</math>

The fraction bar is placed on the "math axis", which is slightly shifted

away from the baseline. For fonts with an OpenType MATH table, this

shift is given by the AxisHeight parameter. In practice, math fonts are

also designed so that binary operators (e.g. the plus sign) has its

vertical center aligned with that math axis too.

Gecko's MathML implementation always adjusts vertical alignment of a few

basic binary operators (namely +, =, *, − ≤ ≥ and ×)

so that there center is aligned with the math axis. In practice, this is

only necessary when non-math fonts are used for MathML rendering but in

that you'll get many other rendering issues.

Also for the sake of testing, some WPT tests use special web fonts with

intentionally large AxisHeight (and so math axis not aligned with the

middle of the binary operators). Having the automatic adjustment makes

harder to deal with these tests.

some basic binary operators for MathML. This was never implemented in

other browsers and is not described in any specification.

Bug to remove: https://bugzilla.mozilla.org/show_bug.cgi?id=1890531

To understand better, here is a basic example:

<!DOCTYPE html>

<link

rel="stylesheet"

href="https://fred-wang.github.io/MathFonts/STIX/mathfonts.css" />

<math style="font: 20pt 'STIX Two Math'">

<mfrac>

<mn>12</mn>

<mn>34</mn>

</mfrac>

<mo>+</mo>

<mn>56</mn>

</math>

The fraction bar is placed on the "math axis", which is slightly shifted

away from the baseline. For fonts with an OpenType MATH table, this

shift is given by the AxisHeight parameter. In practice, math fonts are

also designed so that binary operators (e.g. the plus sign) has its

vertical center aligned with that math axis too.

Gecko's MathML implementation always adjusts vertical alignment of a few

basic binary operators (namely +, =, *, − ≤ ≥ and ×)

so that there center is aligned with the math axis. In practice, this is

only necessary when non-math fonts are used for MathML rendering but in

that you'll get many other rendering issues.

Also for the sake of testing, some WPT tests use special web fonts with

intentionally large AxisHeight (and so math axis not aligned with the

middle of the binary operators). Having the automatic adjustment makes

harder to deal with these tests.

Reply all

Reply to author

Forward

0 new messages

Search

Clear search

Close search

Google apps

Main menu