MathJax icon indicating copy to clipboard operation
MathJax copied to clipboard

Mathjax version 3. Any update regarding font support other than MathJax TeX font?

Open gbala2412 opened this issue 4 years ago • 20 comments

Mathjax version 3. Any update regarding font support other than MathJax TeX font?

gbala2412 avatar Aug 18 '20 07:08 gbala2412

Work is progressing on this, but it is a complicated project. Yesterday, I pushed a stix2 branch that includes an SVG version of the STIX2 fonts. There is a stix2 subdirectory in that branch that includes an example HTML file that shows some stretchy characters, and an interactive file that you can use to type in your own TeX or MathML expressions for testing. There is a cli directory that includes tex2svg and mml2svg commands that you can use to convert individual expressions to SVG files using the STIX2 fonts (and can use as templates for your own custom versions of these). You can compare to the originals from the direct subdirectory of the MathJax node demos repository to see what modifications are needed.

Finally, there is a tables directory that includes font tables for the STIX2 fonts as I've mapped them to the various mathvariant values for MathJax (variants starting with - are internal use to access things like the larger sizes of stretchy delimiters, calligraphic characters, and so on).

This branch currently is intended for server-side pre-processing only, as the data for the STIX2 fonts is very large, and needs to be broken in to pieces that can be loaded dynamically as needed in order to be used effectively in a browser. Then CommonHTML support will follow relatively quickly.

The tools for producing the files needed by MathJax are coming along well, and were used to produce the files in this branch, but are not yet ready for public use.

So while much work has been happening behind the scenes, it is not quite ready yet for prime time. Work is going to slow down as I begin teaching again this fall, so a formal release will probably need to wait until early next year.

dpvc avatar Aug 27 '20 15:08 dpvc

Thank you very much for your reply.

gbala2412 avatar Aug 28 '20 07:08 gbala2412

Are there any news? (Since it is 'early next year' now...)

BrackXs avatar Mar 04 '21 12:03 BrackXs

We are actively working on it. There is a stix2 branch that includes an SVG version of the STIX2 fonts for server-side use (not yet for in-browser use) as an illustration of the effort. We expect to include more fonts in a public release during the summer.

dpvc avatar Mar 04 '21 13:03 dpvc

@BrackXs just a thought: if @le-tex actually supported mathjax, development might just be faster.

pkra avatar Mar 04 '21 14:03 pkra

High on my font wish list are sans serif fonts, such as newtxsf which plays nicely with the popular Fira Sans font.

kno10 avatar Mar 28 '21 15:03 kno10

@kno10 I think you mean sans-serif? I wondered if these changes would make it possible to make use of Fira Math in the future?

imjasonmiller avatar Apr 03 '21 12:04 imjasonmiller

Yes, sans serif obviously. Fira Sans is pretty popular, and I'd like math typography consistent with Fira Sans. Fira Math seems to be work in progress. newtxsf supposedly is quite complete and similar enough for most use cases.

kno10 avatar Apr 03 '21 13:04 kno10

Can we expect Gyre Pagella font in v3?

apolanco115 avatar Aug 23 '21 12:08 apolanco115

@apolanco115, yes. I have the data files ready for Gyre Pagella read to go for the next release (and will have the other Gyre fonts as well). The tools for creating the needed MathJax data files will be made available, so you could create your own font for Fira Sans, or a font extension to override some of an existing font.

dpvc avatar Sep 16 '21 16:09 dpvc

Is there an approximate timeplan for this release? Sorry for pressuring, but loading custom fonts would truly be a blessing.

giancarloantonucci avatar Feb 01 '22 20:02 giancarloantonucci

I expect the font release to be in early Q2 this year.

dpvc avatar Feb 02 '22 15:02 dpvc

@dpvc Any update on the font support?

stnor avatar May 13 '22 11:05 stnor

@stnor, it is coming along, but is taking longer than expected. I have the SVG versions working well for both new fonts and font extensions, and the tools for creating the font data, but still need to do some work for CHTML fonts (the main difference is in the fact that CHTML needs actual fonts rather than svg paths, and the large font files need to be broken into smaller ones to match the layout Mathjax uses). We are finalizing a bug-fix release 3.2.1 for next week, and then will have a major feature release that will include the font work later this year. There are a number of other features being added (including line breaking, HTML in MathML token elements, changes to the assistive tools, some reorganization of the npm packages, etc.), so that is going to be a significant update.

dpvc avatar May 13 '22 12:05 dpvc

Thanks! I'm still running beta3 in prod, and got some help from you back then from you with sans-fonts, so looking forward to upgrade when done! :)

stnor avatar May 13 '22 12:05 stnor

@dpvc I'm making slow progress on the single-stroke math font idea, but it would be brilliant if the new tools & infrastructure allowed this possibility (for experimentation) as well. I bet others would follow and draw their own glyphs, once the opportunity to typeset them via Mathjax is demonstrated.

GRQM

I imagine having the full list of glyphs as a json dictionary containing the svg paths and their placement offsets would be a suitable input format?

baptiste avatar May 14 '22 00:05 baptiste

The 4.0.0 Alpha.1 milestone had in the changelog:

  • Support for 11 different fonts, including the STIX2 font set, five Gyre math fonts, and a sans-serif font based on the Fira-Math font.

So I guess there has been some progress?

kno10 avatar Feb 07 '23 14:02 kno10

Yup, I am using the Fira font in production on alpha.1 since a while back (simple use case - see https://nomp.se/nomp/matematik/93/algebra/forenkling-av-polynom/93.ALGEBRA.9)

stnor avatar Feb 07 '23 15:02 stnor

@kno10, yes, the v4 alpha release has the 11 fonts, and has been well received over all. There are still some issues to resolve, however, and code review is not yet complete (but well underway). I'm hoping a beta release will be soon, followed by the official release shortly thereafter.

dpvc avatar Feb 08 '23 21:02 dpvc

close this, as additional fonts are available in 4.0? Works well for me, specific issues are likely best tracked in their own reports?

kno10 avatar Jan 17 '24 22:01 kno10