2

Section 4, “Font setup”, in the Polyglossia manual provides:

If a specific sans or monospace font is needed for a particular script or language, it can be defined by means of \⟨script⟩fontsf or \⟨language⟩fontsf and \⟨script⟩fonttt or \⟨language⟩fonttt, respectively.

It seems to me that this only holds true if the language for which the sans/monospace font is set is the defaultlanguage. That means, if I use

\setdefaultlanguage{english}
\setotherlanguage{ukrainian}

and then set

\newfontfamily\cyrillicfont{Times New Roman}[Script=Cyrillic]
\newfontfamily\cyrillicfontsf{Arial Black}[Script=Cyrillic]

Polyglossia will not select Arial Black when \sffamily is invoked in a Ukrainian environment but rather default back to the \sffamily for latin, as the log shows:

Missing character: There is no й in font [lmsans10-bold]:mapping=tex-text!

I do not think this to be the expected behaviour but I could not find any hint in the Polyglossia source code as to why this is happening, either.

My question is, then, how can I set up specific sans or monospace fonts for languages other than the defaultlanguage?


MWE:

% !TEX TS-program = xelatex
% !TEX encoding = UTF-8 Unicode

\documentclass{scrartcl}

\usepackage{fontspec}
\usepackage{polyglossia}
\usepackage{lipsum}

\newfontfamily\cyrillicfont{Times New Roman}[Script=Cyrillic]
\newfontfamily\cyrillicfontsf{Arial Black}[Script=Cyrillic]

\setmainlanguage{english}
\setotherlanguage{ukrainian}

\begin{document}
\begin{ukrainian}
\author{А.В. Тор}
\title{Великий об'єм }
\maketitle
\section{Перший}
\sffamily
\lipsum[1]
\end{ukrainian}
\sffamily
\lipsum[1]
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.