-
Notifications
You must be signed in to change notification settings - Fork 13
Description
The OpenType specification says that a request for oldstyle numbers should override any request for lining numbers. I couldn't find anything to the contrary in the luaotfload user guide. However, when I loaded fonts with both +lnum and +onum, the results were unexpected.
I wrote a test file (contents shown below) to load fonts with combinations of these features.
Summary of results: when I requested both lining and oldstyle numbers,
- Fonts with oldstyle numbers in both modes (desired behavior): Baskervald X (LaTeX font catalogue), EB Garamond (LaTeX font catalogue), Noto Serif (Open-source font)
- Fonts with oldstyle numbers only in node mode: Alegreya (LaTeX font catalogue), Cormorant (Open-source font), GFS Bodoni (LaTeX font catalogue)
- Fonts with oldstyle numbers only in base mode: Adobe Garamond Pro (Adobe font)
See the attached pdf files for full results. For context, I'm running a MacTeX distribution that's a couple years old. A mathfont user brought this bug to my attention when he reported a bug in mathfont. (I'm the author of mathfont.) He ran the test file for about ten different fonts on his machine using the most recent TeXLive distribution, and he said the line
\font\lnumonumbase={\fontname:script=LATN;+lnum;+onum;mode=base} at 12pt
made LuaTeX hang indefinitely for everything other than Noto Serif and Sofia Sans. Erasing the .texlive2025 folder, which he believes contains the luaotfload cache, did not solve the problem. In the case of Noto Serif, he got the same results as I did when I ran the test file on Noto Serif on my machine.
Output files:
test-onum-bug-adobegaramondpro.pdf
test-onum-bug-alegreya.pdf
test-onum-bug-baskervaldx.pdf
test-onum-bug-cormorant.pdf
test-onum-bug-ebgaramond.pdf
test-onum-bug-gfsbodoni.pdf
test-onum-bug-notoserif.pdf
Here is the original TeX source:
\documentclass[12pt]{article}
\begin{document}
% change \fontname to font used for testing
\def\fontname{...}
% default numbering
\font\node={\fontname:script=LATN;mode=node} at 12pt
\font\base={\fontname:script=LATN;mode=base} at 12pt
% with +lnum
\font\lnumnode={\fontname:script=LATN;+lnum;mode=node} at 12pt
\font\lnumbase={\fontname:script=LATN;+lnum;mode=base} at 12pt
% with +onum
\font\onumnode={\fontname:script=LATN;+onum;mode=node} at 12pt
\font\onumbase={\fontname:script=LATN;+onum;mode=base} at 12pt
% with both
\font\lnumonumnode={\fontname:script=LATN;+lnum;+onum;mode=node} at 12pt
\font\lnumonumbase={\fontname:script=LATN;+lnum;+onum;mode=base} at 12pt
\parindent=0pt
\node
Current font: \fontname
\bigskip
Default numbering
Node mode: 0123456789
\base Base mode: 0123456789
\bigskip
Lining numbers requested
\lnumnode Node mode: 0123456789
\lnumbase Base mode: 0123456789
\bigskip
Oldstyle numbers requested
\onumnode Node mode: 0123456789
\onumbase Base mode: 0123456789
\bigskip
Both requested (should appear as oldstyle in both modes)
\lnumonumnode Node mode: 0123456789
\lnumonumbase Base mode: 0123456789
\end{document}