Skip to content
This repository has been archived by the owner on Jan 7, 2020. It is now read-only.

Fonts without "names" field #48

Open
kmaed opened this issue Jun 28, 2012 · 1 comment
Open

Fonts without "names" field #48

kmaed opened this issue Jun 28, 2012 · 1 comment

Comments

@kmaed
Copy link

kmaed commented Jun 28, 2012

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.

@Ferada
Copy link

Ferada commented Oct 23, 2012

I had the same problem for a while and just found this issue here. I applied this commit locally (instead of the fix above) to get around the problem (and then uninstalled the font in question).

Well, now I know this, but I agree that either way this shouldn't happen.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants