For the Arabic font ScheherazadeNew, how to resolve this warning
Package fontspec Warning: Language 'Arabic' not available for font(fontspec) 'ScheherazadeNew' with
script 'Arabic'.
for the following document
\documentclass[12pt,a4paper]{article}
\usepackage{fontspec}
\setmainfont[Ligatures = {NoCommon, NoRare}]{Latin Modern Roman}
\newfontfamily\arabicfont{ScheherazadeNew}[ Script = Arabic, RawFeature={+anum}]
\usepackage[english, bidi = basic, layout = lists]{babel}
\babelprovide[import, onchar = ids fonts]{arabic}
\babelfont[arabic]{rm}[Scale = 1]{ScheherazadeNew}
\babelfont[arabic]{sf}[Scale = 1]{ScheherazadeNew}
\begin{document}
\end{document}
Additionally, is it redundant to use \newfontfamily\arabicfont
and \babelfont[arabic]
? Or does each one have different functions?
Best Answer
That MWE looks mostly correct for LuaLaTeX. You don.t need both
\babelfont
and\arabicfont
: the first is forbabel
, which you’re using, and the second would be what you would use withpolyglossia
.You do, however, want to add
\babelfont{rm}{Latin Modern Roman}
rather than\setmainfont{Latin Modern Roman}
, to havebabel
correctly switch between your English and Arabic fonts. It’s also likely that you want to scale the two fonts to the same height, rather thanScale=1.0
.The warning about the font not containing the language
Arabic
is normally harmless. Fonts often don’t bother defining language tags that don’t change anything, like Greek for the Greek script or Hebrew for the Hebrew script. In this case, the font designer didn’t bother declaring an Arabic language for the Arabic script, and making the file slightly bigger, because that’s already the default for the Arabic script. You can suppress the message by loading a font with theLanguage=Default
feature. (In the same place where you currently haveScale=1.0
.)So this might work for you:
The main difference here is that it adds
Scale=1.0
to the main font only, and scales all other fonts in the document to the same x-height as\defaultfontfeatures
.You’ll still get a warning about using the default
tt
(monospace) font family. If you need monospace Arabic, Arabic Latin Modern Fixed is a good match for Latin Modern.You might also have a look at New Computer Modern Book, another clone of Computer Modern that’s slightly thicker than Latin Modern.