
我是乳膠的新用戶。我剛開始用它來寫文章和專著。我對使用混合語言字體(Ethiopic/Ge'ez 和英語)撰寫論文特別感興趣。根據 XeLatex 關於使用 fontspec 的大量建議,我認為我可以在英文正文中編寫 Ethiopic/Ge'ez 字體。然而,在我的多次嘗試中,卻一無所獲!所以,我想知道是否有人可以幫助我為兩種語言創建一個基本的 MWE?這是我多次失敗的嘗試之一(只產生了一堆問號):
微量元素
\documentclass{article}
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainfont{Abyssinica SIL}
\setmainlanguage{english}
\setotherlanguage{geez}
\newfontfamily{\geezfont}[Script=Ethiopic]{Abyssinica SIL}
\newenvironment{geez}
{\geezfont}
{}
\begin{document}
\section*{Section about Tigrinya}
\begin{geez}
እስመ
\end{geez}
\end{document}
答案1
目前,Polyglossia 不支援 Ge'ez,但它對阿姆哈拉語有實驗性支持,距離不遠了。
如果您的文件只有 Ge'ez 語言的小片段,您甚至不需要添加對該語言的支持,以下內容就足夠了。
\documentclass{article}
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainlanguage{english}
\newfontface{\geezfont}{AbyssinicaSIL-Regular.ttf}
\newenvironment{geez}
{\geezfont}
{}
\begin{document}
\section*{Section about Tigrinya}
Text \begin{geez}
እስመ
\end{geez}
\end{document}
您很可能不應該將 Abyssinica SIL 設定為主要字體。
如果您需要語言支持,請執行
\documentclass{article}
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage{amharic}
\newfontface{\amharicfont}{AbyssinicaSIL-Regular.ttf}
\newenvironment{geez}
{\amharic}
{\endamharic}
\begin{document}
\section*{Section about Tigrinya}
Text \begin{geez}
እስመ
\end{geez}
\end{document}
但應該對語言設定進行調整。
筆記。我用顯式文件載入了字體。如果您已在系統範圍內安裝它,那麼
\newfontface{\geezfont{Abyssinica SIL}
應該不錯。
答案2
我從以下位置下載了字體作為 zip 文件
https://software.sil.org/abyssinica/download/
並將主要 ttf 字體放入當前目錄中,然後對範例進行小的修改即可產生此
\documentclass{article}
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainfont{AbyssinicaSIL-Regular.ttf}
\setmainlanguage{english}
%\setotherlanguage{geez}
\newfontfamily{\geezfont}[Script=Ethiopic]{AbyssinicaSIL-Regular.ttf}
\newenvironment{geez}
{\geezfont}
{}
\begin{document}
\section*{Section about Tigrinya}
\begin{geez}
እስመ
\end{geez}
\end{document}
但這對拉丁腳本和天哪部分使用相同的字體,並導致一些粗體不可用的警告。也許您不想將此字體設定為就好像\setmainfont
主要文字是英文一樣,但也許您確實希望獲得一致的字體,即使它受到更多限制。
更簡單的低階範例
\documentclass{article}
\begin{document}
TEST:
\font\zz="[./AbyssinicaSIL-Regular.ttf]" at 20pt
\zz
እስመ
\end{document}