LuaLatex:语言“普什图语”不适用于带有脚本“阿拉伯语”的字体(fontspec)“Amiri-Regular”

LuaLatex:语言“普什图语”不适用于带有脚本“阿拉伯语”的字体(fontspec)“Amiri-Regular”

作为我的后续问题因为我现在对其他语言(如和)Urdu有疑问。我遵循示例和文档,并得到以下 MWE:PashtoPersian

\documentclass{article}
\usepackage{fontspec}
\usepackage[shorthands=off,bidi=basic,english, ngerman]{babel}
\babelprovide[import=ur,mapdigits]{urdu}
\babelfont[urdu]{rm}[Renderer=HarfBuzz]{Amiri}
\babelprovide[import=ps]{pashto}
\babelfont[pashto]{rm}[Renderer=HarfBuzz]{Amiri}
\babelprovide[import=fa]{persian}
\babelfont[persian]{rm}[Renderer=HarfBuzz]{Amiri}

\begin{document}
My urdu test
\selectlanguage{urdu}

    یہ ایک جملہ ہے
{\selectlanguage{pashto}رآورد نفوس کشورد هېواد د و ګړو اټکل1398 [}Estimated Population of Afghanistan 1398 (2019/2020)],     
{\selectlanguage{persian} رآورد نفوس کشورد هېواد د و ګړو اټکل1398 [}Estimated Population of Afghanistan 2020], 

\end{document}

我在用着

This is LuaHBTeX, Version 1.12.0 (TeX Live 2020/TeX Live for SUSE Linux)  (format=lualatex 2020.11.26) 

并收到以下警告:

Language 'Pashto' not available for font(fontspec) 'Amiri-Regular' with script 'Arabic'.
Language 'Persian' not available for font(fontspec) 'Amiri-Regular' with script 'Arabic'.

由于这种方法很有效,Urdu我不知道如何避免这些警告?或者如何进行更好的设置?有什么提示吗?

答案1

该警告是无害的,但您可以通过加载字体来抑制它Language=Default,例如

\documentclass{article}
\usepackage[bidi=basic, nil]{babel}
\usepackage{fontspec}

\defaultfontfeatures{ Renderer=HarfBuzz, 
                      Scale=MatchUppercase, 
                      Ligatures=TeX }

\babelfont{rm}
          [Ligatures=Common, Scale=1.0]{Libertinus Serif}    
\babelprovide[import=ur, mapdigits, main]{urdu}
\babelfont[urdu]{rm}
          {Amiri}
\babelprovide[import=ps]{pashto}
\babelfont[pashto]{rm}
          [Language=Default]{Amiri}
\babelprovide[import=fa]{persian}
\babelfont[persian]{rm}
          [Language=Default]{Amiri}

\babeltags{pashto=pashto}
\babeltags{persian=persian}
\babeltags{urdu=urdu}

可能有必要将 LTR 文本声明为英语,例如“阿富汗人口”。声明\babeltags允许您写入\textpashto{...}而不是{\selectlanguage{pashto}...}

相关内容