[luatex] Luaotfload still cannot embed several new CJK fonts in Mac OS X 10.11 El Capitan

Kazuki Maeda kmaeda at kmaeda.net
Thu Oct 8 05:57:44 CEST 2015


Hi all.

Mac OS X 10.11 El Capitan provides many new CJK fonts as OpenType Collection (but extension is .ttc).
LuaTeX 0.81.0 can handle these new fonts (see rev 5330).
However, luaotfload still cannot embed several fonts, e.g. HiraginoSans-W1, with "Invalid TTC index number" error.

The cause of the problem is that this font does not have subfonts whose PostScript name is same as "fontname" of the font file.
For HiraginoSans-W1, luatex fontloader returns:

...
 ["familyname"]="Hiragino Sans W1",
 ["fontname"]="HiraKakuProN-W1",
 ["fontstyle_id"]=0,
 ["fullname"]="HiraKakuProN-W1",
...

This font file has two subfonts. Their PostScript name are:

...
     ["family"]=".Hiragino Kaku Gothic Interface",
     ["fullname"]=".Hiragino Kaku Gothic Interface W1",
     ["manufacturer"]="SCREEN Graphic and Precision Solutions Co., Ltd.",
     ["postscriptname"]=".HiraKakuInterface-W1",
     ["preffamilyname"]=".Hiragino Kaku Gothic Interface",
...
     ["family"]="Hiragino Sans W1",
     ["fullname"]="Hiragino Sans W1",
     ["manufacturer"]="SCREEN Graphic and Precision Solutions Co., Ltd.",
     ["postscriptname"]="HiraginoSans-W1",
     ["preffamilyname"]="Hiragino Sans",
...

There is no subfont whose postscriptname is "HiraKakuProN-W1".
But luaotfload sets fontname "HiraKakuProN-W1" to psname, and causes "Invalid TTC index number" error.


I attach a patch to luaotfload (or font-otf.lua).
This code reads postscriptname, writes it to font cache as metadata.psname, and sets it to psname.
After applying this patch, you will be able to embed all the new CJK fonts.


Best regards
Kazuki Maeda
-------------- next part --------------
A non-text attachment was scrubbed...
Name: luaotfload-fontloader-otf-psname.patch
Type: text/x-diff
Size: 1271 bytes
Desc: not available
URL: <http://tug.org/pipermail/luatex/attachments/20151008/fa33a7d0/attachment.bin>


More information about the luatex mailing list