我有使用自定义设置加载的自定义字体文件\babelfont
:
\babelfont{assistant}[
Extension = .ttf,
Path = ./fonts/assistant/,
UprightFont=*-Regular,
BoldFont = *-Bold,
ItalicFont = *-Regular,
ItalicFeatures = {FakeSlant=0.3}
]{Assistant}
我想使用具有这些设置的此字体作为rm
我的语言希伯来语的主要字体。我可以复制粘贴定义:
\babelfont[hebrew]{rm}[
Extension = .ttf,
Path = ./fonts/assistant/,
UprightFont=*-Regular,
BoldFont = *-Bold,
ItalicFont = *-Regular,
ItalicFeatures = {FakeSlant=0.3}
]{Assistant}
但感觉不对。无论主字体是什么,我都希望定义自定义字体,这样我就可以始终使用\assistantfamily
和,\assistanttext
以防将来决定使用其他字体。但是,现在我想使用此字体作为主字体。我尝试了和之rm
类的方法,但没有用。如何使用定义为的自定义系列作为主字体?\babelfont[hebrew]{rm}{david}
\babelfont[hebrew]{rm}{\davidfamily}
\babelfont
下面是我使用的代码的一个最小示例:
\documentclass[a4paper, 12pt]{extarticle}
\PassOptionsToPackage{no-math}{fontspec}
\usepackage[bidi=basic, layout=tabular]{babel}
\babelprovide[main, import, alph=letters, Alph=letters]{hebrew}
\babelprovide[import]{english}
% Font setup
\babelfont{assistant}[
Extension = .ttf,
Path = ./fonts/assistant/,
UprightFont = *-Regular,
BoldFont = *-Bold,
ItalicFont = *-Regular,
ItalicFeatures = {FakeSlant=0.3}
]{Assistant}
% How can I use the previously defined `assistant` family instead of copy-pasting its settings?
\babelfont[hebrew]{rm}[
Extension = .ttf,
Path = ./fonts/assistant/,
UprightFont = *-Regular,
BoldFont = *-Bold,
ItalicFont = *-Regular,
ItalicFeatures = {FakeSlant=0.3}
]{Assistant}
\begin{document}
שלום לכולם
\[ E = mc^2 \]
\end{document}
以下是文件结构: