
我需要使用幾種字體建立一個文件。兩種或三種字體將metafont
用於基於拉丁語言的大部分文檔,然後我需要為東南亞語言使用另一種字體(所以可能是 TrueType 字體或類似字體,因為我找不到任何基於 TeX 的字體)適用於東南亞語言的字體)。據我了解,我可以輕鬆地為基於拉丁語的語言組合字體:
\documentclass{book}
\usepackage[T1]{fontenc}
\begin{document}
Regular {\fontfamily{pzc}\selectfont and special} fonts.
\end{document}
給了我想要的效果:
但一旦我添加了fontspec
所需的polyglossia
,Zapf Chancery ( pzc
) 字體就不再起作用:
\documentclass{book}
\usepackage[T1]{fontenc}
\usepackage{fontspec}
\usepackage{polyglossia}
\newfontfamily\thaifont{Norasi}
\setdefaultlanguage{english}
\setotherlanguage{thai}
\begin{document}
English regular {\fontfamily{pzc}\selectfont and special} fonts.\\
\begin{thai}ตัวพิมพ์ภาษาไทย\end{thai}
\end{document}
產生:
有什麼辦法可以避免這個問題嗎?需要明確的是,我思考我必須習慣polyglossia
使用東南亞語言,而且我必須metafont
也使用多種字體。
回答
正如所指出的烏爾里克·費雪,並進一步闡明艾格雷格,\fontencoding
在使用metafont字體時需要指定,fontspec
因為後者需要EU1
而前者需要T1
(我是根據我的理解進行總結的fontencoding
,這並不多)。
\documentclass{book}
\usepackage[T1]{fontenc}
\usepackage{fontspec}
\usepackage{polyglossia}
\newfontfamily\thaifont{Norasi}
\setdefaultlanguage{english}
\setotherlanguage{thai}
\begin{document}
English regular {\fontencoding{T1}\fontfamily{pzc}\selectfont and special} fonts.\\
\begin{thai}ตัวพิมพ์ภาษาไทย\end{thai}
\end{document}
產生正確的輸出:
答案1
您通常能夠找到所需字體的 OpenType/TrueType 替代品,Zapf Chancery 就是這種情況:可以使用 TeX Gyre Chorus 的克隆版本。但也可以使用原生 TeX/Metafont 字體:以下是 Dürer 字體的範例。
\documentclass{book}
\usepackage{fontspec}
\usepackage{polyglossia}
\newfontfamily\thaifont{Sathu} % I don't have Norasi
\newfontfamily\specialfont{TeX Gyre Chorus}
\setmainlanguage{english}
\setotherlanguage{thai}
\usepackage{duerer} % for a MF font
\begin{document}
English regular {\specialfont and special} fonts.\\
\begin{thai}ตัวพิมพ์ภาษาไทย\end{thai}
\textdurm{ABCDE} % duerer has only uppercase
\end{document}
本質上來說\textdurm{ABCDE}
,
{\fontencoding{OT1}\fontfamily{durm}\selectfont ABCDE}
and \fontencoding{OT1}
(或\fontencoding{T1}
) 是您所缺少的,因為 XeLaTeX 和 的預設編碼fontspec
是EU1
.