I was asked to add advanced mathematical symbols and size variants to an already existing font. Since I don’t have experience with mathematical typesetting I did some research and noticed that there are differences in the design of typefaces for text and their math companions.
Some differences I noticed are:
- size and position of basic mathematical symbols like plus, minus etc. (the plus often even goes below the baseline)
- position (and sometimes even an entirely different design) of delimiters like brackets, braces, parentheses etc.
- size and position of the summation sign
There are probably more, but these are the ones that I noticed.
Here are some screenshots from the typefaces I studied:
Fira Math and Fira Sans
The math version has slightly larger + and - which are positioned lower. Even the figures themselves are larger (the same as cap-height).The brace seems to be centred to the minus sign.
Libertinus Math and Libertinus
The overall design of +, - and braces are different – much larger and more distinctive.
I understand that the different application of the typeface leads to different design choices. But what specific criteria do I use to determine the size and position of these characters in math fonts? (+, -, √, ∑, etc.)
Also: How do I determine the size increase of the different delimiter variants?
I’d be grateful for your input!
In mathematical typesetting, many things are aligned vertically along the midline of the math operators, as you have observed with the brace delimiters. Math operators in mathematical publishing tend also to be large—those in Fira Math look very small to me; those in Libertinus Math are better.
Delimiter variants will be selected and scaled by the math handler, so you want to provide enough variants so that a scaled delimiter does not end up too heavy or too light relative to adjacent glyphs. So you don’t need specific heights, just a broad range of heights. In STIX Two Math, I went with 12 variants of each delimiter.
To provide more details to John’s comment, there is a line called the math axis that informs the design. The math axis typically sits at the visual center between baseline and meanline (that is, visually halfway within the x-height). Fraction bars are drawn on the math axis, therefore many math operators should be centered vertically around the math axis, including
These math operators should be predominantly sized to maximize their legibility in formulae. If this leads to a /plus that dips below the baseline, so be it.
Here’s a sample set in 9.43-point Scotch Modern (Nick Shinn) and 10-point Computer Modern Math (Donald E. Knuth):
Yes, I actually looked a lot at STIX Two also. I only didn’t bring it up in the examples, because I was specifically looking for differences between math and text fonts.
Okay, so I have to define the math axis first which then informs my decisions on the size and position of many other glyphs.
Delimiter variants will be selected and scaled by the math handler, so you want to provide enough variants …
And the handler chooses the variant according to the information in the MathVariant and VertGlyphConstruction table, right?
Making a math font seems to be quite an undertaking. How did you go about developing STIX Two? @John Hudson
Is it possible to fill in the information into the math table as you go (and test before adding further information to the MATH table)? Or does the table need to be complete in order to have a valid font?
As I recall, only large operators and variable delimiters are shifted by the math layout engine (TeX calls these extensible symbols), so their vertical position in the font can be arbitrary—the math engine will shift them to be centered around the math axis anyway. For binary operators and relation symbols, the math engine will not tinker with their position—they will appear where you’ve placed them in the font.
Speaking of delimiters, first it is a good idea to make the default delimiters full-body height (or slightly shorter, with visual compensations of course), including /slash and /backslash (the two most commonly overlooked glyphs). Otherwise, formulae such as (a/b) and (p/q) in quick succession will look jarring.
The next larger delimiter size is usually full-line height. Using 10pt Computer Modern Math and 10pt MathTime Professional 2 as examples (both designed to be set on 12pt leading), their /delimiters.size1 are 12pt tall. Normally, the next larger size covers 1.5 lines, so /delimiters.size2 are 18pt tall; then /delimiters.size3 are 24pt tall (2 lines); then /delimiters.size4 are 30pt tall (2.5 lines); and so on—growing in 6pt/half-line increment. This is not an absolute rule: Fira Math, for instance, has finer increment.
We had experience making the Cambria Math font for Microsoft, which had the benefit of being developed alongside the MS math handler. For that and for STIX Two, we used Microsoft’s math font editor, which is a stand-alone tool that directly writes the MATH table. I understand that FontForge has more integrated math font functionality, but have never tried it.
The OpenType MATH table is a descendant of TeX’s math fontdimen’s, which in turn are detailed in Appendix G of The TeXbook (the source text is available online, but it is all text, no illustrations).
For the visually creative crowd, there is Appendix G illuminated by B. Jackowski, which visually explains what the fontdimen’s are supposed to do.
A follow-up paper OpenType math illuminated by U. Vieth covers the parameters of the MATH table.