-
Notifications
You must be signed in to change notification settings - Fork 15
Fonts without "names" field #48
Description
It was reported from some Chinese and Japanese users that there exist fonts without "names" field. For example, the entry for a valid font is written in otfl-names.lua as
{
["familyname"]="TeXGyreTermes",
["filename"]={ "texgyretermes-regular.otf", false },
["fontname"]="TeXGyreTermes-Regular",
["fontstyle_name"]="Regular",
["fullname"]="TeXGyreTermes-Regular",
["names"]={
["family"]="TeX Gyre Termes",
["fullname"]="TeXGyreTermes-Regular",
["psname"]="TeXGyreTermes-Regular",
["subfamily"]="Regular",
},
["size"]={ 100, 200, 50 },
["slant"]=0,
["weight"]=400,
["width"]=5,
}
But entries for some Chinese and Japanese fonts do not have "names" field (["names"]=nil). When these fonts exist on your system and you use luaotfload, the following error occurs:
! LuaTeX error ...1/texmf-dist/tex/luatex/luaotfload/otfl-font-nms.lua:109: att
empt to index field 'names' (a nil value).
<to be read again>
\scan_stop:
l.5 \setmainfont{TeXGyreTermes}
Note that this error occurs even when you load valid fonts (in the above example, the loaded font is TeXGyreTermes).
I don't know whether the fonts without "names" field are valid or invalid. In my opinion, luaotfload should work without the error even if otfl-names.lua includes such invalid entries. Or another solution is that mkluatexfontdb simply ignores such invalid fonts. Hironori Kitagawa wrote a patch for the latter solution.
Of course, I know there is otfl-blacklist.cnf for problematic fonts. But this solution requires users to edit the blacklist file.