使用希腊字符时如何设置字体?

使用希腊字符时如何设置字体?

我已尝试使用字体“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君主制字体有两种可用选项。


不管怎样,我也喜欢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}

相关内容