Fontlex Relaxed Math

The box below is a plain text box holding math the way people type it in plain text: (a+b)/(c+d), x^2, sqrt(x). The font typesets it as you type: fractions, roots, superscripts and subscripts, laid out by the text engine that lays out the letters. Ordinary text stays ordinary, so and/or, w/o, dates and paths are left alone. The characters stay exactly as typed. No script on this page lays anything out.

What it typesets

That is all: this isn't LaTeX or a general math engine. For a little LaTeX, see Fontlex Math, a subset as well.

What stays text

Limits and ambiguous notation

How it works

122 passes read each line the way the rules above say, and rewrite it as the LaTeX that lays out the same: (a+b)/(c+d) as \frac{a+b}{c+d}, with the parentheses as its braces and a \frac and braces that the line doesn't have inserted as glyphs that draw nothing. Then Fontlex Math's own passes lay it out. The font has 55,176 glyphs and 2,044 substitution and 301 positioning lookups.

Results

Each line is shaped with the font, what it draws is read back from the glyphs (characters by name and size, rules from their outlines), and compared with a separate Python model of the notation (relaxed.py), to the font unit.

LinesCountHarfBuzz
Edge cases (incomplete and broken input, and prose)50100.0%
Random formulas and words, some mistyped2,000100.0%

This page checks a sample each time it is built. The full check, 20,000 random lines and the edge cases in HarfBuzz and Core Text, matches the model on every line: see math/README.md.

Base font: JetBrains Mono (SIL Open Font License).