当你在 Windows 上使用 TeX Live 编译包含自定义字体的 LaTeX 文档时,可能会遇到如下错误:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
| kpathsea: Running mktextfm Fontin
The command name is F:\texlive\2025\bin\windows\mktextfm
name = Fontin, rootname = Fontin, pointsize =
mktexmf: empty or non-existent rootfile!
kpathsea: Running mktexmf Fontin.mf
The command name is F:\texlive\2025\bin\windows\mktexmf
Cannot find Fontin.mf.
kpathsea: Appending font creation commands to missfont.log.
kpathsea: Running mktextfm Fontin
The command name is F:\texlive\2025\bin\windows\mktextfm
name = Fontin, rootname = Fontin, pointsize =
mktexmf: empty or non-existent rootfile!
kpathsea: Running mktexmf Fontin.mf
The command name is F:\texlive\2025\bin\windows\mktexmf
Cannot find Fontin.mf.
|
这个错误的原因是 TeX 系统找不到所需的字体文件(特别是 .mf 或 .tfm 文件),因此无法生成它们。奇怪的是,你可能已经安装了该字体。
解决方法其实很简单:将字体安装为 所有用户可用。
- 找到 Fontin 字体文件(例如
Fontin.ttf)。 - 右键点击该文件。
- 从右键菜单中选择 为所有用户安装(Install for all users)。
当字体以所有用户的身份安装完成后,重新编译文档,问题解决。