fontspec:配置專案本機光學字體

fontspec:配置專案本機光學字體

我非常喜歡 Adob​​e 的 Garamond Premier Pro(全套光學元件)。在正常情況下,我可以\setmainfont{Garamond Premier Pro}在桌上型電腦或筆記型電腦上工作時使用它。

然而,由於各種原因,我需要在旅途中進行排版。當然,我不能(也不會)在我使用的每台電腦上安裝 Garamond Premier Pro,因此我需要將其用作「本地」字體,與我在文件中使用的其他字體相同。

問題是,我一生都無法弄清楚如何配置 fontspec 來實際使用所有它。

這是我的文件的一個簡單的、最小的範例:

\documentclass[letterpaper,10pt]{article}
\usepackage[letterpaper]{geometry}
\usepackage{fontspec}

\defaultfontfeatures{Ligatures=TeX}
\setmainfont[
    Path = fonts/Garamond/ ,
    Extension = .otf ,
    SizeFeatures={
        {Size=-8,UprightFont=*-Capt,BoldFont=*-BdCapt,ItalicFont=*-

ItCapt,BoldItalicFont=*-BdItCapt},
        {Size=8-14,UprightFont=*,BoldFont=*-Bd,ItalicFont=*-

It,BoldItalicFont=*-BdIt},
        {Size=14-21,UprightFont=*-Subh,BoldFont=*-BdSubh,ItalicFont=*-

ItSubh,BoldItalicFont=*-BdItSubh},
        {Size=21-,UprightFont=*-Disp,BoldFont=*-BdDisp,ItalicFont=*-

ItDisp,BoldItalicFont=*-BdItDisp}}
    ]{GaramondPremrPro}
\setsansfont[Path = fonts/Optima/ ,
    Extension = .otf ,
    UprightFont = * ,
    BoldFont = *-Bold ,
    ItalicFont = *-Italic ,
    BoldItalicFont = *-BoldItalic
    ]{OptimaLTStd}
\setmonofont[Path = fonts/OCR/ ,
    Extension = .otf ,
    UprightFont = *,
    BoldFont = *
    ]{OCRAStd}

\begin{document}
    Hello, world! \quad \textit{Hello, world!} \quad \textbf{Hello, world!} 

\quad \textbf{\textit{Hello,world!}}

    \textsf{Hello, world! \quad \textit{Hello, world!} \quad \textbf{Hello, 

world!} \quad \textbf{\textit{Hello,world!}}}

    \texttt{Hello, world!}
\end{document}

我的 Optima 和 OCR A 設定工作得很好;事實上,我嘗試使用與 Optima 和 OCR A 字體類似的配置來設定 Adob​​e 的 Caslon,而該檔案編譯得非常完美。

當我嘗試編譯任何內容時出現的錯誤是:

(E:\PORT\MiKTeX\tex\latex\fontspec\fontspec.cfg)))

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! LaTeX error: "kernel/key-unknown"
!
! The key 'fontspec/Size' is unknown and is being ignored.
!
! See the LaTeX3 documentation for further information.
!
! For immediate help type H <return>.
!...............................................

l.14 ^^I]{GaramondPremrPro}

?

我不確定我的 MiKTeX(便攜式)版本正在運行的 fontspec 的精確版本;但我一周前才在我的閃存驅動器上安裝了 MiKTeX(便攜式),並且幾天前它才從軟體包存儲庫下載了 fontspec(我想說三個,但我可能是不正確的)。

總而言之,我正在尋找一些幫助來找出 fontspec 錯誤訊息,並實際找到設定 Garamond Premier Pro 的方法。儘管這適用於需要設定本地光學字體的任何其他時間。


編輯

非常感謝 Ulrike Fischer 指出我的 MWE 中的錯誤。但是問題仍然存在,現在有一個不同的錯誤:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! LaTeX error: "kernel/key-unknown"
!
! The key 'fontspec/UprightFont' is unknown and is being ignored.
!
! See the LaTeX3 documentation for further information.
!
! For immediate help type H <return>.
!...............................................

l.14 ^^I]{GaramondPremrPro}

?

相關內容