我已遵循这个帖子为了使用 XeLaTeX 时 fontawesome 图标过大。我能够使用FontForge并将 Em Size 更改为 1000。我还使用以下 FontForge 的 Python 脚本来生成新字体:
import fontforge
font = fontforge.open("C:/Windows/Fonts/FontAwesome.otf")
font.em = 1000
font.generate("C:/Windows/Fonts/FontAwesome-1000upm.otf")
然后我将其复制FontAwesome-1000upm.otf
到我的 LaTeX 项目目录,并将其安装在我的 Windows 中。\newfontfamily{\FA}{FontAwesome-1000upm}
之后我还将其添加到文档的序言中\usepackage{fontawesome}
,但 XeLaTeX 抱怨它找不到字体。
fontspec error: "font-not-found" The font "FontAwesome-1000upm" cannot be found. For immediate help type H <return>. \newfontfamily{\FA}{FontAwesome-1000upm}
当我检查时C:/Windows/Fonts
,我只能看到FontAwesome Regular
。然而,目录列表显示了其他内容:
C:\Windows\Fonts>dir fontawesome*
Volume in drive C has no label.
Volume Serial Number is B8DD-C28E
Directory of C:\Windows\Fonts
05/05/2015 11:39 AM 101,524 FontAwesome-1000upm.otf
05/05/2015 11:39 AM 101,524 FontAwesome-1000upm_0.otf
04/17/2015 08:56 PM 93,888 FontAwesome.otf
04/17/2015 08:56 PM 93,888 FontAwesome_0.otf
04/17/2015 08:56 PM 93,888 FontAwesome_1.otf
04/17/2015 08:56 PM 93,888 FontAwesome_2.otf
有人可以帮助我解决我所缺少的问题吗?
答案1
通过将路径作为选项传递给以下内容可以解决这个问题\newfontfamily
:
\newfontfamily{\FA}[Path = C:/Windows/Fonts/]{FontAwesome-1000upm}