![上下文中的阿拉伯语后备字体](https://linux22.com/image/443350/%E4%B8%8A%E4%B8%8B%E6%96%87%E4%B8%AD%E7%9A%84%E9%98%BF%E6%8B%89%E4%BC%AF%E8%AF%AD%E5%90%8E%E5%A4%87%E5%AD%97%E4%BD%93.png)
我的目标是用拉丁字母语言编写小块的阿拉伯语/希伯来语文本(单词、段落)。
我一直在尝试使用此处的各种示例来设置阿拉伯语后备字体,但到目前为止结果并不理想(甚至括号也不起作用):
\definefallbackfamily [mainface] [serif] [Adobe Arabic] [range=arabic,feature=arabic]
\definefontfamily [mainface] [serif] [Minion Pro][features=oldstyle]
%\definefontfallback[mainface][sans][range=arabic]
\setupbodyfont[mainface]
\definefontfeature
[arabic]
[mode=node,language=dflt,script=arab,
init=yes,medi=yes,fina=yes,isol=yes,
liga=yes,dlig=yes,rlig=yes,clig=yes,
mark=yes,mkmk=yes,kern=yes,curs=yes]
\define[1]\arabico{\definedfont[name:adobearabic*arabic]\setupalign[r2l]#1}
\starttext
% load the font
{
\definedfont[name:adobearabic*arabic% at 36pt
]
\setupalign[r2l]
ضَرَبَ ضُرِبَ ضَرْبًا(
)
ضَرَبَ ضُرِبَ ضَرْبًا
}
%
%\d{D}
Teste: %font loads, no right-to-left
(ضَرَبَ ضُرِبَ ضَرْبًا)
Teste {\definedfont[name:adobearabic*arabic]\setupalign[r2l]ضَرَبَ ضُرِبَ ضَرْبًا}
%works, but parenthesis doesn't
asdf (\arabico{ضَرَبَ ضُرِبَ ضَرْبًا})
\stoptext
答案1
经过几天的反复试验,匆忙浏览手册、文档、wiki(默认情况下其 typescript 甚至不起作用)和这个网站,我自己找到了解决方案:
\definefallbackfamily[myfamily][serif][Amiri][features=arabic,range=arabic] %range=arabic was luck by analogy
\definefontfamily [myfamily] [serif] [Minion Pro][features=oldstyle]
\definefontfamily [myfamily] [sans] [Myriad Pro][features=oldstyle] % ss = sans serif
\definefontfamily [myfamily] [mono] [Consolas] % tt = teletype
\definefontfamily [myfamily] [math] [Cambria Math] %
\setupbodyfont [myfamily,11pt]
\setupbodyfont[myfamily]
\setupdirections[bidi=global] %not in wiki
\starttext
أهلاً وسهلاً
\language[fr]
Asdf; 134890: a!
\stoptext