使用时lualatex
,我收到以下错误:
</usr/local/share/fonts/HoodHeaven Ornaments Two SSi.ttf>
!LuaTeX error: cannot find OpenType font file for reading ()
==> Fatal error occurred, no output PDF file produced!
该文件存在且可读:
$ otfinfo -i "/usr/local/share/fonts/HoodHeaven Ornaments Two SSi.ttf"
Family: HoodHeaven Ornaments Two SSi
Subfamily: Regular
Full name: HoodHeaven Ornaments Two SSi
PostScript name: HoodHeavenOrnamentsTwoSSi
Version: 001.000
Unique ID: FontMonger:HoodHeaven Ornaments Two SSi
Copyright: Copyright c 1995 CdExpert Software, Inc. All Rights Reserved.
并且缓存中的名称是正确的:
{
["familyname"]="HoodHeaven Ornaments Two SSi",
["filename"]={ "/usr/local/share/fonts/HoodHeaven Ornaments Two SSi.ttf", false },
["fontname"]="HoodHeavenOrnamentsTwoSSi",
["fullname"]="HoodHeaven Ornaments Two SSi",
["names"]={
["family"]="HoodHeaven Ornaments Two SSi",
["fullname"]="HoodHeaven Ornaments Two SSi",
["psname"]="HoodHeavenOrnamentsTwoSSi",
["subfamily"]="Regular",
},
["size"]={},
["slant"]=0,
["weight"]=400,
["width"]=5,
},
可能出了什么问题?
答案1
我保存了 ttf 文件没有空格并尝试使用 LuaLaTeX 和 XeLaTeX,没有问题。
\documentclass{article}
\usepackage{fontspec}
\setmainfont{HoodHeaven Ornaments One SSi}
\begin{document}
abcdefABCDEF
\end{document}
答案2
原来是另一种字体(EB Garamond Italic)的问题,我的系统中版本有问题。重新复制此字体后,一切正常。