Would replacing the character in a supported font work?

19 views
Skip to first unread message

xutia...@gmail.com

unread,
May 16, 2017, 12:09:49 PM5/16/17
to MathJax Users
Hi,

I am using Latin Modern to display Latex. And we want to use an open number '4' to replace original given '4'.
So I modified the '4' in the below files inside \fonts\HTML-CSS\Latin-Modern\woff\ folder

'LatinModernMathJax_SansSerif-Regular.woff'
'LatinModernMathJax_Normal-Regular.woff'

But we still see the ouput is the same as before, and modified character is not appearing.

Questions

Would this approach work?
Which file(s) we should modify to see the customized character?

Regards,
John Xu

Davide Cervone

unread,
May 20, 2017, 6:40:54 AM5/20/17
to mathja...@googlegroups.com
It would not be a good idea to modify the fonts in the MathJax distribution (unless you also rename them both in terms of the file name and the metadata within the file).  The HTML-CSS output jax is set up to use a locally installed version of the fonts, if there is one, and so even if you modify your web-based version, you may not see the change if you have the original installed locally.  Also, it is a very bad idea to have fonts with the same name but different characters.

In addition, you would need to provide not just the WOFF versions, but also the OTF and EOT versions of the fonts, as these are used by some browsers.

Finally, you would have to modify the data files used by MathJax to store the bounding box information for all the glyphs in the fonts.

So this is not a good approach.

A better one would be to create a new font with just the one new glyph that you need (or several fonts, if you need it in more than one style, as your message suggests you do), create the associated data for them, and insert that into the output jax's font data tables at the appropriate places.  This is non-trivial, but could be done.

Davide


--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

xutia...@gmail.com

unread,
Jun 6, 2017, 9:28:39 AM6/6/17
to MathJax Users

Thanks Davide.
Reply all
Reply to author
Forward
0 new messages