1

As a followup of my question for Urdu I have now the question for the other languages like Pashto and Persian. I follow the sample and the doc and have the following MWE:

\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}

I'm using

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

and get the following warnings:

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

Since this works fine for Urdu I have no clue how to avoid these warnings? Or how to make a better setup? Any hints?

3
  • see github.com/wspr/fontspec/issues/421 Commented Nov 30, 2020 at 8:05
  • You’ve edited the question after people answered, which is best to avoid if possible. As edited, you should provide a font for English/German. I would recommend Libertinus Serif or Linux Libertine as a good match for Amiri.
    – Davislor
    Commented Nov 30, 2020 at 8:44
  • Yeah, OK, I'll take care the next time. Wasn't made to screw up things and I acknowledge your point.
    – LeO
    Commented Nov 30, 2020 at 8:59

1 Answer 1

2

The warning is harmless, but you can suppress it by loading the font with Language=Default, e.g.

\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}

It might be worthwhile declaring English for the LTR text, such as “Population of Afghanistan.” The \babeltags declarations let you write \textpashto{...} instead of {\selectlanguage{pashto}...}.

3
  • Thx to have an idea how to get rid of the warnings :-) With your answer you add defaultfontfeatures and the Renderer. Is this 'required' since this would apply to English texts as well. Thx as well for the explanation of babeltags since I would have asked for this as well :-)
    – LeO
    Commented Nov 30, 2020 at 8:36
  • @LeO The document does not currently support English. If you did, selecting the HarfBuzz renderer for it is benign. (XeTeX uses HarfBuzz as well.) You could, if you wanted, override it with Renderer=Node.
    – Davislor
    Commented Nov 30, 2020 at 8:38
  • I've updated my sample with the babel definition I finally use. Thx for the explanation but I think I stick to the approach and define the Renderer in the font. Unless there is a specific reason to not do so. Anyway thx for the help.
    – LeO
    Commented Nov 30, 2020 at 8:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .