答案1
使用支援希伯來斜體的字體,例如 Culmus 字體:
\documentclass[12pt]{article}
\usepackage[bidi=default, english]{babel}
\usepackage{fontspec}
\usepackage{parskip}
\babelprovide[import, main]{hebrew}
\defaultfontfeatures{ Ligatures = TeX, Scale = MatchUppercase }
\babelfont{rm}[Scale = 1.0, Ligatures = Common, Language = Default]{TeX Gyre Bonum}
\babelfont{sf}[Ligatures = Common, Language = Default]{TeX Gyre Heros}
\babelfont{tt}[Language = Default]{Inconsolatazi4}
\babelfont[hebrew]{rm}[Language = Default]{David CLM}
\babelfont[hebrew]{sf}[Language = Default]{Miriam CLM}
\babelfont[hebrew]{tt}[Language = Default]{Miriam Mono CLM}
\begin{document}
שלום עולם
\textit{שלום עולם}
\end{document}
這種特殊字體的斜體從右向左傾斜。如果您希望從左到右傾斜(匹配拉丁文字和許多以色列文字處理程序),請改用FakeSlant
.在這裡,我將其定義為傾斜字體(\slshape
或\textsl
):
\documentclass[12pt]{article}
\usepackage[bidi=default, english]{babel}
\usepackage{fontspec}
\usepackage{parskip}
\babelprovide[import, main]{hebrew}
\defaultfontfeatures{ Ligatures = TeX, Scale = MatchUppercase }
\defaultfontfeatures[DavidCLM]{
UprightFont = {*-Medium},
BoldFont = {*-Bold},
SlantedFont = {*-Medium},
BoldSlantedFont = {*-Bold},
SlantedFeatures = {FakeSlant = 0.15},
Extension = {.otf}
}
\babelfont{rm}[Scale = 1.0, Ligatures = Common, Language = Default]{TeX Gyre Bonum}
\babelfont{sf}[Ligatures = Common, Language = Default]{TeX Gyre Heros}
\babelfont{tt}[Language = Default]{Inconsolatazi4}
\babelfont[hebrew]{rm}[Language = Default]{DavidCLM}
\babelfont[hebrew]{sf}[Language = Default]{Miriam CLM}
\babelfont[hebrew]{tt}[Language = Default]{Miriam Mono CLM}
\begin{document}
שלום עולם
\textsl{שלום עולם}
\end{document}
答案2
這在穩定的 Debian 系統上可以正常工作 - 儘管我不得不使用\setmainfont{David CLM}
( Debian 中\setmainfont{David}
沒有David
可用的字體,只有David CLM
)