Page MenuHomePhabricator

Increase font size for MathML
Closed, ResolvedPublic

Details

Related Gerrit Patches:
mediawiki/extensions/Math : masterIncrease font size for MathML

Event Timeline

Change 283236 had a related patch set uploaded (by Physikerwelt):
Increase font size for MathML

https://gerrit.wikimedia.org/r/283236

Nsoranzo removed a subscriber: Nsoranzo.Apr 13 2016, 5:59 PM
fredw added a subscriber: fredw.Apr 13 2016, 6:01 PM

Note that this should not be needed if the math font style is consistent
with the one of the text font (e.g. Latin Modern with Latin Modern
Math). The percent is a bit arbitrary and won't work for everybody.
Unfortunately very few standard fonts have a math companion and few math
fonts are available on OS at the moment...

@fredw You are certainly right. However, this default seems to look better for most peole. Can you suggest an alternative method, that has the same for lets's say "standard users", but does not disturb "advanced users" that have set up their fonts correctly.

+1 to what @fredw said. Perhaps a better solution would be for the font size to be configurable per-wiki, with the default being 100%. IMHO forcing a certain size on everybody can only lead to bike-shedding and disagreements.

I don't think this really blocks T78046 - I see the font size as an added value. Also, a corollary of the above paragraph is that determining the exact font size for each wiki by each community will take some time.

Ok. Maybe there should be a guide for people how have permission to edit the Common.css how to change the font size.

Change 283236 abandoned by Physikerwelt:
Increase font size for MathML

Reason:
Configure in Common.css on individual wikis

https://gerrit.wikimedia.org/r/283236

Dvorapa removed a subscriber: Dvorapa.Apr 13 2016, 8:35 PM

The wish the German community voted for was for having similar font-sizes for different rendering methods (HTML, PNG, SVG, MathML). Does someone have a suggestion how to get there using the Common.css?

@Physikerwelt could you create a quick guide for this?

fredw added a comment.Apr 24 2016, 3:59 PM

On
https://de.wikipedia.org/wiki/MediaWiki_Diskussion:Common.css#Schriftgr.C3.B6.C3.9Fe_f.C3.BCr_MathML,
there is a reference to
https://dxr.mozilla.org/mozilla-central/source/modules/libpref/init/all.js
and to the x-math properties.

More explanations:

  • The Firefox user agent stylesheet

https://dxr.mozilla.org/mozilla-central/source/layout/mathml/mathml.css
sets the math text to "serif" by default.

  • font.name.serif.x-math indicates the default font to use for the

generic "serif" font-family on the math element, which is "Latin Modern
Math".

  • font.name-list.serif.x-math|| indicates a list of fallback math fonts.

Note that you can configure these families from the font preference
menu. Go to edit -> preferences -> content -> fonts & colors -> advanced
-> fonts for "Mathematics". (there is also a "hidden" menu in about:config)

However, Mediwiki's stylesheet changes the font-family on the math
element to some list of math fonts. So maybe we should now keep the
default user agent stylesheet value instead. Firefox users could them
just configure their math font with the font menu.

Edokter added a comment.EditedApr 24 2016, 6:31 PM

@fredw, the current release version (45) still uses the internal font stack, which is why I find it odd we override it in the first place. But if the internal stack is removed, we may as well leave it.

I choose 118% for HTML math based on the most common fonts being used: Arial and Times New Roman. At 118%, their x-height matches. This in no way will guarantee matching sizes when different fonts are used, but it is the closest match for all. With MathML, different font come into play, and without know what fonts are actually being used, there is not much sense picking a size. For now (on enwiki), 118% seems to work well given the current fonts (Arial/Cambria) on Windows.

fredw added a comment.Apr 24 2016, 6:49 PM

Le 24/04/2016 20:32, Edokter a écrit :

@fredw, the current release version (45) still uses the internal font stack, which is why I find it odd we override it in the first place. But if the internal stack is removed, we may as well leave it.

I think the rule was added in MediaWiki before
https://bugzilla.mozilla.org/show_bug.cgi?id=947654 was fixed. The
internal stack is unlikely to be removed soon (except if in the very
long term all text fonts get a math companion and then Gecko can switch
to math font "automatically").

So it seems at the moment that the only reason we override font-family
in MediaWiki is to provide the LatinModernWOFF fallback on Desktop.

Physikerwelt closed this task as Resolved.Apr 25 2016, 6:00 PM

OK. This should be resolved now. http://en.wikipedia.beta.wmflabs.org/wiki/Math displays now SVG by default.
I added a description how to enable MathML on Firefox and InternetExplorer to https://www.mediawiki.org/wiki/Extension:Math#Viewing_math
A follow up task could be to refine that description, but I think we can just modify the Wikipage and no not need to create phabricator tasks for that.