使用 XeLaTeX,如何使用已下载到文件夹中但尚未安装在系统中的字体?我尝试在 中指定路径setmainfont{Path = C:/MyFolder/MyFonts/
,但收到错误消息fontspec error: "font-not-found"
根据我在谷歌上搜索到的内容,我尝试了这些选项,但它们都给出相同的错误消息:
\setmainfont{Path = C:/MyFolder/MyFonts/}{LinLibertine_Rah.ttf}
\setmainfont{Path = C:/MyFolder/MyFonts/LinLibertine_Rah.ttf}
\setmainfont{Path = C:/MyFolder/MyFonts/}{LinLibertine}
\setmainfont{Path = C:/MyFolder/MyFonts/LinLibertine}
\setmainfont{Path = C:/MyFolder/MyFonts/}{Linux Libertine}
\setmainfont{Path = C:/MyFolder/MyFonts/Linux Libertine}
\setmainfont[Path = C:/MyFolder/MyFonts/]{LinLibertine_Rah.ttf}
\setmainfont[Path = C:/MyFolder/MyFonts/LinLibertine_Rah.ttf]
\setmainfont[Path = C:/MyFolder/MyFonts/]{LinLibertine}
\setmainfont[Path = C:/MyFolder/MyFonts/LinLibertine]
\setmainfont[Path = C:/MyFolder/MyFonts/]{Linux Libertine}
\setmainfont[Path = C:/MyFolder/MyFonts/Linux Libertine]
答案1
根据我收到的评论和建议,我在此提供解决方案。
\setmainfont[ Path = C:/MyStuff/Fonts/LinLibertineTTF/,
Extension = .ttf,
BoldFont = LinLibertine_RBah,
ItalicFont = LinLibertine_RIah,
BoldItalicFont = LinLibertine_RBIah,
SmallCapsFeatures = {Letters = SmallCaps},
Numbers = OldStyle
]{LinLibertine_Rah}
避免在路径中使用空格和下划线。
答案2
您是否尝试过将第一组花括号改为方括号?即:
\setmainfont[Path=C:/MyFolder/MyFonts/]{LinLibertine_Rah.ttf}
看Fontspec 文档v2.2b,第 7-8 页。