未找到 Fontspec BoldFeatures 字体

未找到 Fontspec BoldFeatures 字体

我正在尝试使用 fontspec 和 xelatex 将 TeX Gyre Heros 的小型大写字母改成 Helvetica;这是我的代码的 MWE:

\documentclass{standalone}
\usepackage{fontspec} %v2.5a

%\setmainfont{texgyreheros-bold.otf} % this works
%\setmainfont{Helvetica} % this also works
\setmainfont{Helvetica}[BoldFeatures = { SmallCapsFont = {texgyreheros-bold.otf} }] % this does not work
\begin{document}
Test
\end{document}

正如您在评论中看到的那样,Helvetica 和 TeX Gyre Heroes 单独使用都可以正常工作。但是,如果我尝试将 TeX Gyre Heroes 指定为 Helvetica 的粗体/小写字体,则会出现以下错误:

kpathsea: Running mktextfm texgyreheros-bold/AAT
/usr/local/texlive/2016/texmf-dist/web2c/mktexnam: Could not map source abbreviation A for AAT.
/usr/local/texlive/2016/texmf-dist/web2c/mktexnam: Need to update /usr/local/texlive/2016/texmf-dist/fonts/map/fontname/special.map?
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input AAT
This is METAFONT, Version 2.7182818 (TeX Live 2016) (preloaded base=mf)


kpathsea: Running mktexmf AAT
! I can't find file `AAT'.
<*> \mode:=ljfour; mag:=1; nonstopmode; input AAT

Please type another input file name
! Emergency stop.
<*> \mode:=ljfour; mag:=1; nonstopmode; input AAT

Transcript written on mfput.log.
grep: AAT.log: No such file or directory
mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input AAT' failed to make AAT.tfm.
kpathsea: Appending font creation commands to missfont.log.


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! fontspec error: "font-not-found"
!
! The font "texgyreheros-bold.otf" cannot be found.
!
! See the fontspec documentation for further information.
!
! For immediate help type H <return>.
!...............................................

l.6 ... SmallCapsFont = {texgyreheros-bold.otf} }]
                                                   % this does not work

我可以使用 fontspec (这种方式) 混合使用 Helvetica 和 TeX Gyre Heros 吗?如果不行,为什么?(我不知道发生了什么,但我希望了解一下,以避免将来出现陷阱。)

如果我遗漏了任何重要信息,请告诉我。

谢谢你的时间。

答案1

似乎混合渲染器不被接受fontspec

\documentclass{article}
\usepackage{fontspec} %v2.5a

\setmainfont{Helvetica}[
  Renderer=OpenType,
  BoldFeatures = {
    SmallCapsFont = {TeX Gyre Heros/B},
  },
  SmallCapsFeatures = {
    Script=Default,
    Language=Default,
    Letters=SmallCaps,
  },
] % this does not work

\setsansfont{TeX Gyre Heros}

\begin{document}
Test\textbf{\textsc{Abc}}

\sffamily % as a check
Test\textbf{\textsc{Abc}}

\end{document}

在此处输入图片描述

相关内容