Re:Safari 16.4 Is an Admission
by masswerk on Thursday February 23, 2023 @01:43AM
(#34907554)
Now I really want to see Chrome catching up on some basics, as well, like monospaced text. (Why Chrome, are Greek letters of different width?)
[ Parent
| on HN ]
Not sure of the specifics, but if certain glyphs are not in a font, it falls through to the next font in the stack. Got a repro?
Here is a use case: While MathML is a web standard since 1997, there is no support for it. Still, we want to write "x = y × ε + c". And we want this to line up with another formula on the next line. Or you want to write down a simple matrix, where one of the elements is a Greek letter, but still would like numbers to line up vertically (it's a matrix!).
This works with any kind of preformatted text (like a "pre" element with the generic monospaced font-family) in every browser, as it has, since there have been browsers, but not with Chrome. For Chrome, we have to put epsilon in a span element, make it display as inline-block, assign a width (0.6em), align the character inside this box, just to write a very basic formula! (I call this "training wheels for text".)
Repro:
x = y × ε + c
y = x × 1 + c
⎛ 1 −1 ⎞
⎜ ⎟
⎝ ε 1 ⎠
Writing the character "ε" for Chrome: <span style="display: inline-block; width: 0.6em; text-align: center; overflow: visible; margin: 0; padding: 0; box-sizing: border-box;">ε</span>