CTeX-org / ctex-kit

Macro Packages and Scripts for Chinese TeX users
972 stars 124 forks source link

Texlive 2021 找不到字体! #597

Closed xaero7 closed 2 years ago

xaero7 commented 2 years ago

环境:

Windows 10 (or Windows 11)
Texlive 2021
编译:  txs:///xelatex

MWE:

\documentclass{ctexart}
\setCJKmainfont{FZQiTi-S14S}
%\setCJKmainfont{方正启体简体.TTF}
\begin{document}
  衬线\textbf{加粗}\textsf{无衬线}  
\end{document}

第2行代码,如果用字体名称写\setCJKmainfont{FZQiTi-S14S},它会报错:

Package fontspec Error: The font "FZQiTi-S14S" cannot be found. \begin

错误日志是:

开始 : xelatex.exe -synctex=1 -interaction=nonstopmode "main-win".tex

name = FZQiTi-S14S/OT, rootname = FZQiTi-S14S/OT, pointsize = mktexmf: empty or non-existent rootfile!
kpathsea: Running mktexmf FZQiTi-S14S/OT.mf The command name is C:\texlive\2021\bin\win32\mktexmf Cannot find FZQiTi-S14S/OT.mf.
name = FZQiTi-S14S/OT, rootname = FZQiTi-S14S/OT, pointsize = mktexmf: empty or non-existent rootfile!
kpathsea: Running mktexmf FZQiTi-S14S/OT.mf The command name is C:\texlive\2021\bin\win32\mktexmf Cannot find FZQiTi-S14S/OT.mf.
name = FZQiTi-S14S/OT, rootname = FZQiTi-S14S/OT, pointsize = mktexmf: empty or non-existent rootfile!
kpathsea: Running mktexmf FZQiTi-S14S/OT.mf The command name is C:\texlive\2021\bin\win32\mktexmf Cannot find FZQiTi-S14S/OT.mf.
name = FZQiTi-S14S/BI/OT, rootname = FZQiTi-S14S/BI/OT, pointsize = mktexmf: empty or non-existent rootfile!
kpathsea: Running mktexmf FZQiTi-S14S/BI/OT.mf The command name is C:\texlive\2021\bin\win32\mktexmf Cannot find FZQiTi-S14S/BI/OT.mf.
name = FZQiTi-S14S/OT, rootname = FZQiTi-S14S/OT, pointsize = mktexmf: empty or non-existent rootfile!
kpathsea: Running mktexmf FZQiTi-S14S/OT.mf The command name is C:\texlive\2021\bin\win32\mktexmf Cannot find FZQiTi-S14S/OT.mf.
name = FZQiTi-S14S/B/OT, rootname = FZQiTi-S14S/B/OT, pointsize = mktexmf: empty or non-existent rootfile!
kpathsea: Running mktexmf FZQiTi-S14S/B/OT.mf The command name is C:\texlive\2021\bin\win32\mktexmf Cannot find FZQiTi-S14S/B/OT.mf.
name = FZQiTi-S14S/OT, rootname = FZQiTi-S14S/OT, pointsize = mktexmf: empty or non-existent rootfile!
kpathsea: Running mktexmf FZQiTi-S14S/OT.mf The command name is C:\texlive\2021\bin\win32\mktexmf Cannot find FZQiTi-S14S/OT.mf.
name = FZQiTi-S14S/I/OT, rootname = FZQiTi-S14S/I/OT, pointsize = mktexmf: empty or non-existent rootfile!
kpathsea: Running mktexmf FZQiTi-S14S/I/OT.mf The command name is C:\texlive\2021\bin\win32\mktexmf Cannot find FZQiTi-S14S/I/OT.mf.
name = FZQiTi-S14S/OT, rootname = FZQiTi-S14S/OT, pointsize = mktexmf: empty or non-existent rootfile!
kpathsea: Running mktexmf FZQiTi-S14S/OT.mf The command name is C:\texlive\2021\bin\win32\mktexmf Cannot find FZQiTi-S14S/OT.mf.
name = FZQiTi-S14S/OT, rootname = FZQiTi-S14S/OT, pointsize = mktexmf: empty or non-existent rootfile!
kpathsea: Running mktexmf FZQiTi-S14S/OT.mf The command name is C:\texlive\2021\bin\win32\mktexmf Cannot find FZQiTi-S14S/OT.mf.
name = FZQiTi-S14S/OT, rootname = FZQiTi-S14S/OT, pointsize = mktexmf: empty or non-existent rootfile!
kpathsea: Running mktexmf FZQiTi-S14S/OT.mf The command name is C:\texlive\2021\bin\win32\mktexmf Cannot find FZQiTi-S14S/OT.mf.
kpathsea: Running mktextfm FZQiTi-S14S/OT The command name is C:\texlive\2021\bin\win32\mktextfm kpathsea: Appending font creation commands to missfont.log. kpathsea: Running mktextfm FZQiTi-S14S/OT The command name is C:\texlive\2021\bin\win32\mktextfm kpathsea: Running mktextfm FZQiTi-S14S/OT The command name is C:\texlive\2021\bin\win32\mktextfm kpathsea: Running mktextfm FZQiTi-S14S/BI/OT The command name is C:\texlive\2021\bin\win32\mktextfm kpathsea: Running mktextfm FZQiTi-S14S/OT The command name is C:\texlive\2021\bin\win32\mktextfm kpathsea: Running mktextfm FZQiTi-S14S/B/OT The command name is C:\texlive\2021\bin\win32\mktextfm kpathsea: Running mktextfm FZQiTi-S14S/OT The command name is C:\texlive\2021\bin\win32\mktextfm kpathsea: Running mktextfm FZQiTi-S14S/I/OT The command name is C:\texlive\2021\bin\win32\mktextfm kpathsea: Running mktextfm FZQiTi-S14S/OT The command name is C:\texlive\2021\bin\win32\mktextfm kpathsea: Running mktextfm FZQiTi-S14S/OT The command name is C:\texlive\2021\bin\win32\mktextfm kpathsea: Running mktextfm FZQiTi-S14S/OT The command name is C:\texlive\2021\bin\win32\mktextfm
出现错误

但是我用注释掉的那行,用字体文件名写\setCJKmainfont{方正启体简体.TTF},就能编译成功! 当然,在Texlive 2020 + win 10下面,无论哪种方法可以,都能编译!

字体应该是实际存在的,fc-list命令列出的结果是:

C:/Windows/fonts/方正启体简体.TTF: FZQiTi\-S14S,鏂规鍚綋绠€浣?style=Regular

怎么搞?

stone-zeng commented 2 years ago

试一下把字体文件改成英文名再刷新字体缓存

atxy-blip commented 2 years ago

请在字体文件上右键选择“为所有用户安装”,以上代码即可被正常编译。

gsxgoldenlegendary commented 2 years ago

请在字体文件上右键选择“为所有用户安装”,以上代码即可被正常编译。

仍然不能解决

muzimuzhi commented 2 years ago

@gsxgoldenlegendary 提个新 issue 吧,提供一些「是什么字体、在什么版本的什么操作系统等信息」。

gsxgoldenlegendary commented 2 years ago

@gsxgoldenlegendary 提个新 issue 吧,提供一些「是什么字体、在什么版本的什么操作系统等信息」。

已经解决了,问题没有出在这里。打扰了!

Cyc1e183 commented 5 months ago

想问下怎么解决的,出现了相同的问题

muzimuzhi commented 5 months ago

@Cyc1e183 请把你的问题,在 https://github.com/CTeX-org/forum/issues 发一个新 issue,同时提供像 https://github.com/CTeX-org/ctex-kit/issues/597#issue-1062029847 里那样的具体信息。(不要在当前 issue 里继续评论。)