Page MenuHomePhabricator

Always use Latin Modern Math for native MathML
Closed, InvalidPublic


This is a follow-up of

Of course this is a recurrent bug: native MathML rendering is very poor without appropriate font with a MATH table. Even with an OpenType MATH font, using a font other than "Latin Modern Math" gives result different from the default "Computer Modern" style used by the SVG and PNG output. Users who are not aware of that get inconsistent results. We can always improve the doc to tell them to install fonts, but that won't stop people from complaining.

Currently, the only OpenType MATH font installed by default is Cambria Math on Windows, but it sometimes give bad rendering results in Gecko (especially for square root IIRC). Also, I opened various enhancement requests to get math fonts installed by default on other systems but that does not seem likely to happen anytime soon...

So the alternative, on the MediaWiki side, is to always have a fallback with Latin Modern Math Web fonts. However, using big Web fonts on MediaWiki server has been controversial in the past, so I'm not sure we can do that. But I'm opening this bug as a reference for future changes...

Current status: As I read the code, the default font-family on the math is

font-family: Cambria, Cambria Math, Latin Modern Math, STIX Math, LatinModernMathWOFF, serif

and LatinModernMathWOFF is only loaded on desktop. So the Web fonts are likely to be used only on Mac/Linux. Extending that to mobile & Windows is likely to significantly increase server requests.

Event Timeline

fredw created this task.Jul 26 2015, 11:05 AM
fredw raised the priority of this task from to Needs Triage.
fredw updated the task description. (Show Details)
fredw added subscribers: fredw, SalixAlba, Physikerwelt.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 26 2015, 11:05 AM
fredw set Security to None.
fredw updated the task description. (Show Details)

@fredw: Can you imagine to break this down into subtasks?

Physikerwelt triaged this task as Medium priority.Aug 2 2015, 12:14 PM
fredw updated the task description. (Show Details)Sep 23 2015, 8:09 PM
fredw added a comment.Sep 23 2015, 8:14 PM

I removed my comment about Windows line spacing bug has it is fixed in Gecko 41. Latin Modern Math should now work on all platforms. For details, see

@fredw: Can you imagine to break this down into subtasks?

I'm not sure. The only thing that has to be done on MediaWiki side is

  1. Upload a woff version of Latin Modern Math on the server.
  2. Update the font-family on the <math> in our CSS stylesheet

(Of course, this might not be needed at all if OS vendors preinstall appropriate fonts)

w.r.t 1: uploading the woff files to the git repo is not a problem, if the licencse allows that. Can you elaborate on that and point to a place where we one can find the fonts, or even better submit a patch.
2 seems trival.

Pkra added a subscriber: Pkra.Dec 6 2018, 10:03 PM

Given that MathML is currently not visually displayed, this seems a non-issue. (Users who customize the rendering to display MathML can add the necessary CSS to their customization.)

Pkra closed this task as Invalid.Dec 6 2018, 10:03 PM