This is arguably a bug in polyglossia. Examining the polyglossia.sty
one sees it has a concept of \familytype
. When the user has selected a language, the font selection is influenced by it this tests the value of \familytype
.
There is some code to set during package loading \familytype
:
\expandafter\ifx\familydefault\sfdefault
\def\familytype{sf}
\else\expandafter\ifx\familydefault\ttdefault
\def\familytype{tt}
\else
\def\familytype{rm}
\fi\fi
This has two issues:
arguably it should be done at begin document, not during package loading, to allow user's redefinitions of \familydefault
anywhere in the preamble (and personally I would wish to also be able to define it in the document body, it is not immediately clear to me why polyglossia
needs its own \familytype
rather than \familydefault
, restricting the efficiency of the latter).
the \expandafter\ifx\familydefault
constrains user's definition of \familydefault
to be done in a certain way, actually it constrains it to be in the style of the OP: \renewcommand*\familydefault{\sfdefault}
. In particular \let\familydefault\sfdefault
would lead to unexpected outcome. But ideally the full expansion should be used.
Thus there are two work-arounds: first one is to do \renewcommand*\familydefault{\sfdefault}
before loading polyglossia
, alternative is to do \def\familytype{sf}
at the end of the preamble.
First method:
\documentclass{article}
\renewcommand*\familydefault{\sfdefault}
\usepackage{polyglossia}
\setdefaultlanguage[spelling=new]{german}
\def\test{test}
%\def\familytype{sf}
% \tracingmacros1
\begin{document}
\test
\end{document}
% Local Variables:
% TeX-engine: xetex
% End:
Second method:
\documentclass{article}
%\renewcommand*\familydefault{\sfdefault}
\usepackage{polyglossia}
\setdefaultlanguage[spelling=new]{german}
\def\test{test}
\def\familytype{sf}
% \tracingmacros1
\begin{document}
\test
\end{document}
% Local Variables:
% TeX-engine: xetex
% End:

\renewcommand*
with\newfontfamily\germanfont{Arial}
or whatever other font you want. See section 4 of thepolyglossia
documentation. – Mike Renfro Jan 26 '16 at 3:21fontsetup=true
which triggers Polyglossia's automatic font configuration. – cfr Jan 26 '16 at 3:46\normalfont
and this will break all of them. – cfr Jan 26 '16 at 3:50\setmainfont
or similar. – cfr Jan 26 '16 at 3:51