上下文中的阿拉伯语后备字体

上下文中的阿拉伯语后备字体

我的目标是用拉丁字母语言编写小块的阿拉伯语/希伯来语文本(单词、段落)。

我一直在尝试使用此处的各种示例来设置阿拉伯语后备字体,但到目前为止结果并不理想(甚至括号也不起作用)在此处输入图片描述

\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

相关内容