
我剛剛安裝了一個名為“28 Days Later”的字體www.1001freefonts.com但現在我遇到了一個問題,因為以下程式碼片段無法編譯,它會產生一些錯誤,大致意思是「找不到 28 天後字體。」。
\documentclass[preview,border=12pt,12pt,varwidth]{standalone}
\usepackage{fontspec}
\setmainfont{28 Days Later}
\begin{document}
Oh my ghost
\end{document}
那麼,我們如何知道作為 的參數傳遞的已安裝字體的正確名稱\setmainfont
?
答案1
(不幸的是)這不適用於該28 Days Later
字體,因為xelatex
編譯會因某些error 11
.
主要方法是使用\setmainfont{fontname}[options]
手冊指出fontspec
,如果字體是由檔案名稱(而不是字體名稱)指定的,則必須設定以下字體選項
- 粗體
- 斜體字體
- 粗斜體字體
由於28 Days Later.ttf
失敗,我winnie.ttf
從同一個網站使用,僅用於演示和主要途徑,但這當然不是問題的解決方案。
\documentclass[preview,border=12pt,12pt,varwidth]{standalone}
\usepackage{fontspec}
\setmainfont{winnie}[
Extension=.ttf,
UprightFont=winnie,
BoldFont=winnie,
ItalicFont=winnie,
BoldItalicFont=winnie,
SmallCapsFont=winnie]
\begin{document}
Oh my ghost
\end{document}