mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-04 02:11:49 +09:00
Backport #39491 by @Copilot On Linux and ChromeOS, Chromium resolves the `math` font family to Latin Modern Math, which neither installs, so MathML renders with a text font and brackets and large operators don't stretch, see https://issues.chromium.org/issues/40069293. The new `--fonts-math` variable keeps `math` first, so browsers that always resolve it keep their font. Only Chromium falls through to the math fonts Linux and ChromeOS install by default: - `STIX Two Math`: Fedora, and `fonts-stix` on Ubuntu 26.04 - `DejaVu Math TeX Gyre`: Debian 13 and openSUSE - `Noto Sans Math`: Fedora and ChromeOS, last because Debian and Ubuntu ship an older version without a `MATH` table Math fonts also have smaller x-heights than UI fonts, so MathML rendered smaller than KaTeX and the surrounding text in every browser, see https://github.com/w3c/mathml-core/issues/41. `font-size-adjust: ex-height 0.52` scales whichever math font is used to KaTeX's x-height. KaTeX output is unchanged. Fixes: https://github.com/go-gitea/gitea/issues/39489  Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: bircni <75789103+bircni@users.noreply.github.com> Co-authored-by: silverwind <me@silverwind.io>