Last modified: 2014-05-16 10:35:06 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T65016, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 63016 - (Config) Enable local STIX fonts for MathJax
(Config) Enable local STIX fonts for MathJax
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Math (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-03-24 16:54 UTC by Erwin Dokter
Modified: 2014-05-16 10:35 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Erwin Dokter 2014-03-24 16:54:05 UTC
Currently, MathJax 2.3 is installed, but local STIX fonts are blocked in its configuration.

MathJax should "prefer" *local* STIX font, and fall back to using TeX webfonts. This is the default behaviour for MathJax 2.3.

Sorry, I can't submit a patch; I don't have a local repository.
Comment 1 Andre Klapper 2014-03-27 19:20:08 UTC
Is this about code in MathJax or is this about configuration of some Wikimedia servers?
Comment 2 Erwin Dokter 2014-03-27 20:02:27 UTC
MathJax has its own configuration file (config/default.js), which is where the change needs to be made.
Comment 3 Peter Krautzberger 2014-03-28 09:38:09 UTC
@Andre this is about the configuration used by the MediaWiki Math Extension.

Specifically, this line https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FMath/88d3368c23efc963ceae127bea175191bc82893e/modules%2Fext.math.mathjax.enabler.js#L25

    availableFonts: ["TeX"]

which restricts MathJax to only use locally installed MathJax-TeX fonts.

The MathJax default (see http://docs.mathjax.org/en/latest/options/HTML-CSS.html) is

   availableFonts: ["STIX","TeX"]

and in the next MathJax release any other MathJax-compatible font a user might have installed will be recognised as well.

Peter.
Comment 4 Erwin Dokter 2014-03-28 17:48:18 UTC
MathJax config is complicated at best, but I think it needs to be:

    availableFonts: ["STIX","TeX"]
    preferredFont: "STIX"
    webFont: "TeX"

This should cause to use STIX or TeX when locally available, or TeX webfont if no local fonts are available.
Comment 5 Peter Krautzberger 2014-03-28 20:38:19 UTC
@Erwin do you intentionally want to force the preference for locally installed fonts to STIX? 

Since the math extension currently prefers TeX webfonts (not STIX webfonts), it seems more natural to prefer TeX.

This also comes at no price for your personal preference -- if you don't install the TeX fonts on your machine, MathJax will still prefer locally installed STIX fonts over any webfonts (as long as availableFonts allows it). 

The preferredFont value only decides which locally installed fonts to prefer if multiple compatible fonts are installed.
Comment 6 Erwin Dokter 2014-03-28 22:32:41 UTC
@Peter, yes. I prefer the STIX fonts, and the word is that the next major version of MathJax (3.0?) will include the STIX webfonts and use it as default.
Comment 7 Peter Krautzberger 2014-03-31 08:27:04 UTC
(In reply to Erwin Dokter from comment #6)
> @Peter, yes. I prefer the STIX fonts, and the word is that the next major
> version of MathJax (3.0?) will include the STIX webfonts and use it as
> default.

MathJax v2.3 already includes STIX webfonts but there are no plans to make them the MathJax default.
Comment 8 Erwin Dokter 2014-03-31 18:14:08 UTC
(In reply to Peter Krautzberger from comment #7)
> MathJax v2.3 already includes STIX webfonts

I had to check that... Indeed they do (though they are not the native upcoming STIX 2.0 webfonts). Even so, all the better. So why are we not using STIX instead of that midievil TeX font?

At the very least, it should be set to its default:
    availableFonts: ["STIX","TeX"],
    preferredFont: "TeX",
    webFont: "TeX",
Comment 9 Peter Krautzberger 2014-03-31 20:53:35 UTC
> though they are not the native upcoming STIX 2.0 webfonts

Not sure what you are referring to here. MathJax contributed the STIX webfonts to STIpub in November (when MathJax v2.3 came out). The STIX webfonts are based on the older "STIX General" fonts because the newer "STIX Word" fonts do not work fully in browsers right now.
Comment 10 Erwin Dokter 2014-04-01 09:58:31 UTC
Just forget it... a year ago they were still talking about 2.0. Apparently they made it 1.1.1 instead.

Point is, can we please restore the default config?

And I have to ask again (and please refer me to the proper developer if not here): why *are* we not using STIX as default?
Comment 11 Derk-Jan Hartman 2014-04-01 12:03:13 UTC
Everything we have is copied from Nageh's script originally, so I assume this used to be in there as well.

So.... do I need to remove this line ?
https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FMath/88d3368c23efc963ceae127bea175191bc82893e/modules%2Fext.math.mathjax.enabler.js#L25
Comment 12 Peter Krautzberger 2014-04-01 14:44:25 UTC
@Derk-Jan yes, deleting that line should do the trick.
Comment 13 nageh 2014-04-04 23:51:15 UTC
@DJ: Since I'm still getting these mails... I had changed my setup to prefer STIX fonts back on April 1, 2012. ;-) Anyway, while you're at editing that file, I suggest adding extensions: ["color.js"] to the config environment to make the \color commands compatible with texvc (and LaTeX). See http://docs.mathjax.org/en/latest/tex.html#color
-nageh
Comment 14 Derk-Jan Hartman 2014-04-05 09:07:04 UTC
ehm. color.js is no longer in the setup ? I'm sure we added that at some point..
Comment 15 Gerrit Notification Bot 2014-04-05 09:58:13 UTC
Change 124055 had a related patch set uploaded by TheDJ:
Reset the fontstack of mathjax back to defaults

https://gerrit.wikimedia.org/r/124055
Comment 16 nageh 2014-04-05 10:32:23 UTC
I think so, too, I guess color.js got lost at some point during the rewrite. Btw, why is the input/MathML jax part of the config? Unless I'm mistaken the mediawiki backend doesn't provide any means for generating MathML.
Comment 17 Derk-Jan Hartman 2014-04-05 10:51:22 UTC
@Nageh, that's for what physikerwelt is working on with his Math 2.0 and MathSearch

http://arxiv.org/abs/1304.5475
https://www.mediawiki.org/wiki/Extension:MathSearch
Comment 18 Gerrit Notification Bot 2014-04-05 11:56:30 UTC
Change 124055 merged by jenkins-bot:
Reset the fontstack of mathjax back to defaults

https://gerrit.wikimedia.org/r/124055
Comment 19 Derk-Jan Hartman 2014-04-07 13:11:52 UTC
It seems that we are missing some STIX font information, that RL cannot load right now.

Debug mode shows we are missing the following: http://pastebin.com/4dR6Je6y
Comment 20 Erwin Dokter 2014-04-07 14:16:12 UTC
This is exactly why I posted a followup question in r124055: where is the default config stored? If there is none, then it should be added in MathJaxEnabler.js.
Comment 21 Erwin Dokter 2014-04-07 14:17:21 UTC
That is //gerrit.wikimedia.org/r/#/c/124055/
Comment 22 Erwin Dokter 2014-04-07 14:17:54 UTC
Where is a Bugzilla linking cheat cheat? Last attampt:

https://gerrit.wikimedia.org/r/#/c/124055/
Comment 23 Derk-Jan Hartman 2014-04-07 14:25:06 UTC
@Erwin in ./unpacked/jax/output/HTML-CSS/config.js

But that is not the problem. We are missing the render information for the font. STIX doesn't just work, it needs to have information about the font in order to do the proper layouting. we are currently not serving that information, because the files are not in the repo and they are not provided as a bundle using RL from Math.php
Comment 24 Erwin Dokter 2014-04-07 15:34:07 UTC
Using TeX webfonts doesn't fare much better: http://pastebin.com/JL9LJCmL

Yet both seemingly display OK.
Comment 25 Frédéric Wang 2014-04-07 19:23:47 UTC
(In reply to Erwin Dokter from comment #24)
> Using TeX webfonts doesn't fare much better: http://pastebin.com/JL9LJCmL
> 
> Yet both seemingly display OK.

I believe these fonts (Greek, WinChrome and WinIE6) are obsolete. The woff files are not in MathJax v2.3 but the js font data are still there. I think we can remove them from Math.php so that the resource loader won't load them (and we can remove the js data from the repo).
Comment 26 Frédéric Wang 2014-04-07 19:34:36 UTC
(In reply to Frédéric Wang from comment #25)
> I believe these fonts (Greek, WinChrome and WinIE6) are obsolete. The woff
> files are not in MathJax v2.3 but the js font data are still there. I think
> we can remove them from Math.php so that the resource loader won't load them
> (and we can remove the js data from the repo).

Well, actually some fonts are still available as otf/eot/svg. I think it would be best to ask to the MathJax team which fonts are still used and in which situations. But as I recall, these fonts were only a hack for old browsers unable to display some characters.
Comment 27 Erwin Dokter 2014-05-16 10:35:06 UTC
I see no more errors and the default configuration has been restored, rendering STIX fonts when installed. I consider this resolved.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links