使用希臘字元時如何設定字體?

使用希臘字元時如何設定字體?

我已經嘗試過使用字體“Charis SIL”、“Times”和“Times New Roman”:

\documentclass[a5paper]{article}

%\usepackage[utf8]{inputenc}
%\usepackage[LGR,T1]{fontenc}
\usepackage[greek,british]{babel}

\usepackage{fontspec}
\setmainfont{Charis SIL}

\begin{document}

This is a simple test. \textgreek{ὅθεν ὤφειλεν κατὰ πάντα}. And orgé as well.

Without slash textgreek ἱλαστήριον (hilasterion)

\end{document}

使用時在PDF中出現é xelatex,但希臘語沒有出現,無論我使用哪種字體,並且該Charis SIL字體應該有這些字符,它們在使用該字體的其他程式中工作。這是我在日誌中得到的內容,也許我沒有正確設定前面?任何提示將不勝感激。

LaTeX Font Warning: Font shape `LGR/CharisSIL(0)/m/n' undefined
(Font)              using `LGR/cmr/m/n' instead on input line 15.

Missing character: There is no ὅ in font grmn1000!
Missing character: There is no θ in font grmn1000!
Missing character: There is no ε in font grmn1000!
....
Missing character: There is no ἱ in font Charis SIL/OT:script=latn;language=DFLT;mapping=tex-text;!
Missing character: There is no τ in font Charis SIL/OT:script=latn;language=DFLT;mapping=tex-text;!

在此輸入影像描述

答案1

你需要這樣的東西,儘管這不太正確。至少,它對我來說不太有效,因為 Charis SIL 不支持希臘語。至少,我的版本沒有:

otfinfo -s /usr/share/fonts/ttf-charis-sil-ibx/CharisSIL-R.ttf 
DFLT            Default
cyrl            Cyrillic
cyrl.SRB        Cyrillic/Serbian
latn            Latin
latn.IPPH       Latin/Phonetic transcription—IPA conventions
latn.VIT        Latin/Vietnamese

但是,如果您替換合適的字體,它應該可以正常工作。

\documentclass[a5paper]{article}

\usepackage{polyglossia}
\setmainlanguage[variant=british]{english}
\setotherlanguage{greek}
\usepackage{fontspec}
\setmainfont{Charis SIL}
\newfontfamily\greekfont{Charis SIL}

\begin{document}

This is a simple test. \textgreek{ὅθεν ὤφειλεν κατὰ πάντα}. And orgé as well.

Without slash textgreek ἱλαστήριον (hilasterion)

\end{document}

答案2

嚴格來講查里斯·SIL專為拉丁文和西里爾文文字設計。請參閱常見問題:為什麼該字體有一些希臘字符,但不是全部?:

雖然該字體確實包含一些希臘字符,但它並不旨在為希臘語言提供一般支援。包含這些希臘字符是為了支援各種(主要是語言的)符號系統。如果需要希臘文支持,加拉太SIL龍騰字體有兩個可用選項。


就其價值而言,我也喜歡GFS蒿:

\documentclass[a5paper]{article}
\usepackage{fontspec}
\setmainfont{Charis SIL}
% \newfontfamily\greekfont{Charis SIL}
\newfontfamily\greekfont[Scale=MatchLowercase]{GFS Artemisia}

\usepackage{polyglossia}
\setmainlanguage[variant=british]{english}
\setotherlanguage[variant=polytonic]{greek}

\begin{document}

This is a simple test. \textgreek{ὅθεν ὤφειλεν κατὰ πάντα}. And orgé as well.

% note: the Greek will fail here because you are not using \greekfont (and Charis SIL doesn't have the characters)
Without slash textgreek ἱλαστήριον (hilasterion)

\end{document}

相關內容