fontspec: \addfontfeatures 不起作用

fontspec: \addfontfeatures 不起作用

在下面的範例中,我為預設的 LaTeX 字體添加了一些功能並由\addfontfeatures編譯XeLatex,但所有這些功能都不起作用。為什麼以及如何讓它們發揮作用?

\documentclass{article}
\usepackage{fontspec}
\begin{document}
\addfontfeatures{Color=123456,Opacity=0.3,Scale=5}
ABCD
\end{document}

答案1

正如評論中所提到的:\setmainfont{Latin Modern Roman}在文件開頭添加是有效的。

\documentclass{article}
\usepackage{fontspec}
\begin{document}
\setmainfont{Latin Modern Roman}
\addfontfeatures{Color=123456,Opacity=0.3,Scale=5}
ABCD
\end{document}

一些額外的信息。

  1. 預設字體拉丁現代羅馬。

    fontspec.sty 在哪裡以及如何指定預設字體(拉丁現代羅馬)?

    為什麼 xelatex 和 lualatex 的預設字體是 Latin Modern?

  2. 這個答案解釋了.fd文件的作用。字型在 LaTeX 中如何運作?

  3. \fontname\font不一定給出姓氏。引用 fontspec 文件:

    字體規範文檔

    實驗上,它看起來\fontname會給出你傳遞給\font命令的任何輸入。

    \documentclass{article}
    \usepackage{fontspec}
    \begin{document}
    
    \font\abc=[[[lmroman9-regular\relax
    \abc
    \fontname\font
    
    \font\deg={Latin Modern Roman}\relax
    \deg
    \fontname\font
    
    \end{document}
    

    輸出影像

  4. 我不知道為什麼 fontspec 和 LaTeX 核心不能開箱即用。

相關內容