Fontspec 错误:定义光学尺寸(XeLaTeX)

Fontspec 错误:定义光学尺寸(XeLaTeX)

这是一篇转贴至此主题,因为似乎没有人能够解决这个问题。我将在两个平台上分享解决方案。

编译以下 MWE 时我收到此错误:

!
! fontspec error: "font-not-found"
! 
! The font "--" cannot be found.
! 
! See the fontspec documentation for further information.
!

l.27 ... {Size = {19.91-},      Font = *-SemiboldItalicDisplay}}}]

我检查了代码、字体名称和字体安装位置(thisMWE.tex/fonts/MinionPro-SemiboldItalicDisplay.otf)。有什么建议吗?这是字体规范错误吗?非常感谢您的帮助!:D

% !TeX program = xelatex 
% !TeX encoding = UTF-8 Unicode 
\documentclass[paper=a4]{scrbook} 

\usepackage[no-math]{fontspec} 

\setmainfont{MinionPro}[Path=fonts/serif/,Extension=.otf,Kerning=On,Numbers={Proportional,OldStyle},Style=Historic,Scale=1,Ligatures=Common,
UprightFeatures = { SizeFeatures = {
        {Size =     {-8.4},  Font = *-Caption},
        {Size =  {8.4-13},   Font = *},
        {Size =   {13-19.9}, Font = *-Subhead},
        {Size = {19.9-},     Font = *-Display}}},
BoldFeatures = { SizeFeatures = { 
        {Size =     {-8.4},  Font = *-SemiboldCaption},
        {Size =  {8.4-13},   Font = *-Semibold},
        {Size =   {13-19.9}, Font = *-SemiboldSubhead},
        {Size = {19.9-},     Font = *-SemiboldDisplay}}},
ItalicFeatures = { SizeFeatures = { 
        {Size =     {-8.4},  Font = *-ItalicCaption},
        {Size =  {8.4-13},   Font = *-Italic},
        {Size =   {13-19.9}, Font = *-ItalicSubhead},
        {Size = {19.9-},     Font = *-ItalicDisplay}}},
BoldItalicFeatures = { SizeFeatures = { 
        {Size =     {-8.4},  Font = *-SemiboldItalicCaption},
        {Size =  {8.4-13},   Font = *-SemiboldItalic},
        {Size =   {13-19.9}, Font = *-SemiboldItalicSubhead},
        {Size = {19.9-},     Font = *-SemiboldItalicDisplay}}}] 

\usepackage{blindtext} 
\begin{document} 
\chapter{Not relevant at all} 
\blindtext[5] 
\end{document} 
%%% Local Variables: 
%%% mode: latex 
%%% TeX-engine: xetex 
%%% TeX-PDF-mode: t 
%%% coding: utf-8 
%%% TeX-master: t 
%%% End:

答案1

还定义字体(这里是我的 Minion Pro 字体):

UprightFont = *-Regular,
BoldFont = *-Medium,
ItalicFont = *-It,
BoldItalicFont = *-MediumIt,

相关内容