"Optical sizes" of fonts; recent default CM font is too thin at small sizes

11 views
Skip to first unread message

Jacob Rus

unread,
Aug 12, 2026, 8:33:09 PMAug 12
to MathJax Users
Hi MathJax folks.

I've tried searching your website, mailing list archives, bug tracker, etc., but I can't find any past discussion about the topic of small fonts getting illegibly thin and the possibility of fonts with optical sizes, which seems to me to be important for high-quality mathematical typography.

To be concrete: mathematical typography, more even than other typography, is full of small symbols, used for e.g. inline fractions, nested fractions, limits of an integral or sum, labels over arrows or equals signs, (sometimes nested) exponents, and so on. To be ideally legible, in high quality typography each font size uses subtly different symbol shapes, even within a particular typeface: While each symbol appears, from a distance, to have the same basic shape, if you look closely or take the various fonts and re-scale them to the same size, you will find that the smaller symbols are relatively bolder, have chunkier details which are sometimes simplified, have larger counters (internal spaces), are typically a bit wider relative to their height, and so on.

In the original TeX/Metafont, this was achieved by having letter shapes specified as formulas which took the size in as one parameter. Computer Modern, to take the basic example, is supposed to have letters whose shapes differ substantially between a heading, body text, and a superscript. In recent versions of (La)TeX, I think the same thing is often achieved by having multiple versions of each font, though I'm not an expert on the internal details of (La)TeX font selection. If you set a LaTeX document with Computer Modern or another high-quality math font, using default settings, you should see different letter shapes for different font sizes, so that e.g. `$x^{x^x}$` will use three different shapes for the single letter `x` at three sizes.

In recent times, OpenType has a "variable fonts" feature, which is now, to my understanding, pretty well supported by the main browsers using CSS; see

* https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Fonts/Variable_fonts
* https://drafts.csswg.org/css-fonts-4/#propdef-font-optical-sizing

Such a variable font can achieve the benefits of arbitrary optical sizes while not taking nearly as much storage, because the various outlines mostly involve the same set of Bézier curves with the control point positions just tweaked slightly, and the variations be effectively compressed.

But most digital typography, including MathJax as far as I can tell, is instead done with a single vector outline for each symbol, which is uniformly scaled up or down when it needs to be used at a different size. This has the benefit of being simpler to implement and maybe taking a bit less data, but the serious downside that the appearance is not properly optimized for most sizes and is therefore often not as legible as it should be.

This especially matters for MathJax because in recent versions the default version of Computer Modern used has gotten significantly thinner than the previous default version. At typical text sizes, this is slightly less legible but mostly okay (though as a matter of personal preference I think it looks kind of anemic).

But for superscripts and especially for nested exponents, fractions in exponents, exponents in text-style fractions, etc., the MathJax default font, which is simply scaled down, is *much* too thin and becomes a mostly illegible smear, difficult to read even for viewers with good eyesight and high quality displays.

Has there been any consideration of supporting, in MathJax output, separate fonts for each range of font sizes, optimized for the size? Or, better still, of supporting "variable fonts" that have variable weight or include the "optical size" variable?

(I don't personally know whether there has been any effort to make an OpenType "variable font" out of Computer Modern or other common math fonts. But it seems at least theoretically achievable.)

All the best,
Jacob Rus
Reply all
Reply to author
Forward
0 new messages