OpenType Math Fonts

This repository hosts a collection of OpenType Math fonts in OTF and WOFF2 formats along with some test pages displaying the pages with MathML.

Using the Web Fonts Served from this site

Each font family made available from this site has a mathfonts.css file which defines a suitable CSS font-face. It does not define a CSS selector that selects this family, allowing you to select different font families in different parts of the document.

So if for example you wish math to be in Noto Sans Math, add:

  <link rel="stylesheet" href="https://mathfonts.github.io/NotoSans/mathfonts.css"/>
  <style>
    math {font-family: Noto Sans Math;}
  </style>
  

Some of the mathfont.css files also define suitable font face names for a matching text font, for example you could add
body {font-family: Noto Sans;}
If the entire document should be in Noto Sans. Note however that in general the text fonts are not served from this site and the text font declarations rely on locally installed fonts.

A list of all the regular weight Math woff2 fonts served from this site.

Using the Web Fonts from your own server

The current repository files may be obtained from the Zip file generated by GitHub. The font directories may then be unpacked into a suitable location on your server and then used as above.

Testing WOFF2 fonts with MathML

MathML Accents Font Test
Test showing a range of MathML accent constructs side by side in a wide table. A column selector allows fewer fonts to be displayed or an additional test font to be dropped on to the page.
MathML Expression Font Test
Test showing a range of MathML examples side by side in a wide table. A column selector allows fewer fonts to be displayed or an additional test font to be dropped on to the page.
Editable MathML Expression Font Test
A version of the previous test that shows a single MathML expression displayed in a range of fonts. the expression may be directly entered as MathML or generated from ASCIIMath or LaTeX syntax using JavaScript convertors hosted on this site. This page also has the option to drop a local font on to the page for testing.
MathML Test of Larger Expressions
Original test file from Frédéric Wang's upstream repository showing MathML fonts in context with a drop down menu allowing a different font to be chosen. The file has been slightly modified to fit the directory layout here and show the extended set of fonts. This test will also show text fonts in some cases but the text fonts rely on locally installed files.
Mozilla MathML Test
Original Mozilla Test File, as hosted at Frédéric Wang's upstream repository showing MathML fonts in context with a drop down menu allowing a different font to be chosen. The file has been slightly modified to fit the directory layout here and show the extended set of fonts.

Testing OTF Fonts with LuaTeX

LuaLaTeX Sample Generator
LaTeX Table generator with a similar interface to the MathML tests. Select the desired fonts and a test LaTeX expression and a (wide or tall) PDF document will be generated at TeXLive.net in a new tab.
Testing with LuaLaTeX
All the freely available fonts described here are installed at TeXLive.net The above link leads to an editable test file that shows the outcome of using the fonts with LuaLaTeX.

Generating WOFF2 Fonts

This repository includes a python script to convert OTF files to WOFF format, as described in the Repository README. The majority of the WOFF2 files are generated by this script, however some of the newer families, such as Plex, include WOFF2 files in their original distribution, in which case they are used here, and for others the conversion was done using the fontforge font editor which can save fonts in a variety of formats.


Documentation of OpenType Math Layout

Documentation of Editor Syntax used in test pages


Cookies and Privacy

By default this site does not set any cookies. Optionally the state of some pages may be saved in cookies by use of the Save State (Cookies) button.
Fonts used with Drag and Drop are not uploaded to a server, they remain on your local machine.
PDF generation uploads the sample LaTeX text to https://texlive.net The TeX expression is immediately deleted, and the generated PDF is deleted after an hour.


Source Repository