Closed 3x closed 3 years ago
Hi! Thanks for investigating this issue. Why can't we just remove Menlo from the CSS font list?
I've kept your idea but changed the code: https://github.com/parpalak/upmath.me/commit/de2a0bafaef9ee731a6db987e6d6c5a8dc7c5a3a
I've chosen JetBrains Mono as a fallback font, not Ubuntu Mono. And I've skipped link rel="preconnect"
(there is another one) and display=swap
(media="none" onload="if(media!='all')media='all'"
works in the same way).
Thanks for reporting the issue. I hope it will fix problems like this: https://github.com/parpalak/upmath.me/issues/11
I've noticed a text rendering error while using upmath.me on an iPad, and only recently on my desktop machine.
This only occured after I installed the
Menlo
font (default monospaced font on iPadOS/MacOS), which has different widths for weights 400 and 700. Since the<texteditor>
element does not render certain strings as bold, this causes misalignment between the actual editor element and the preview overlay on top of it.You can see this here, where my cursor is at the end of the gray editable text, while the blue preview extends farther.
This can be resolved by disabling the certain fonts which have variable widths.
My resolution for the issue is removing Menlo, Monaco, and Courier New from the system font stack, and replacing them with
Consolas, "Liberation Mono", "Ubuntu Mono", monospace
. Consolas will resolve on modern Windows machines, Liberation Mono is the monospaced default on many GNU/Linux distrobutions, and "Ubuntu Mono" can be loaded from Google Fonts for MacOS/other machines which do not have these other default fonts. All of these fonts do not vary in width when changing widths, eliminating this issue.Please let me know what you think!