I recently noticed that the generated database, by default, record the optical size in sp. However, it seems that the sizes are calculated incorrectly. (Or maybe I misunderstood the behavior of luaotfload)
(I don't have any configuration file, so everything is in its default setting)
Consider the entry for Latin Modern Roman, in particular the line,
{ 652911.58156912, 718202.73972603, 620266.00249066, 843 },
within the r table (regular). This line corresponding to LMRoman10-Regular,
The reported optical size through otfinfo is
design size 10 pt, size range (9.5 pt, 11 pt], subfamily ID 1, subfamily name Regular
If I understand correctly, these values are PostScript points, that is, the sp value shall be,
11pt => 11 / 72 * 72.27 * 65536 => 723599.36
While in the table, the corresponding value 718202.73972603 is actually,
In particular, this cause problems when selecting font when the size is specified according to bp instead of pt. For example,
\documentclass{article}
\def\FontName{
\directlua{
local i = font.current()
local f = font.getfont(i)
local n = f.fullname
tex.sprint(n)
}
}
\usepackage{fontspec}
\setmainfont{Latin Modern Roman}
\begin{document}
\fontsize{10.99995}{11}\selectfont % slightly smaller than 11pt
\FontName
\fontsize{11.04124}{11}\selectfont % slightly smaller than 11bp
\FontName
\end{document}
The output is

(I recall that luaotfload used to select font by regarding the optical size as an Closed-Open interval, while OpenType use an Open-Closed interval, and thus I used font size very slightly smaller than the upper bound of the intended use)
In the above example, for 11bp, the 10 point fonts shall be used, but the 12 point one is used instead.
After patching the database by using the values 723599.36 etc, the expected output is obtained

I recently noticed that the generated database, by default, record the optical size in
sp. However, it seems that the sizes are calculated incorrectly. (Or maybe I misunderstood the behavior of luaotfload)(I don't have any configuration file, so everything is in its default setting)
Consider the entry for Latin Modern Roman, in particular the line,
within the
rtable (regular). This line corresponding to LMRoman10-Regular,The reported optical size through
otfinfoisIf I understand correctly, these values are PostScript points, that is, the
spvalue shall be,While in the table, the corresponding value
718202.73972603is actually,In particular, this cause problems when selecting font when the size is specified according to
bpinstead ofpt. For example,The output is

(I recall that
luaotfloadused to select font by regarding the optical size as an Closed-Open interval, while OpenType use an Open-Closed interval, and thus I used font size very slightly smaller than the upper bound of the intended use)In the above example, for
11bp, the 10 point fonts shall be used, but the 12 point one is used instead.After patching the database by using the values
723599.36etc, the expected output is obtained