![LuaTeX 无法找到现有的 TTF 字体](https://linux22.com/image/240160/LuaTeX%20%E6%97%A0%E6%B3%95%E6%89%BE%E5%88%B0%E7%8E%B0%E6%9C%89%E7%9A%84%20TTF%20%E5%AD%97%E4%BD%93.png)
使用时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)的问题,我的系统中版本有问题。重新复制此字体后,一切正常。