reutenauer / polyglossia

An alternative to Babel for XeLaTeX and LuaLaTeX
http://www.ctan.org/pkg/polyglossia
MIT License
185 stars 52 forks source link

Warning: empty features added to latin font when using Chinese #606

Closed sievertst closed 6 months ago

sievertst commented 8 months ago

Each time I try to enter text tagged as Chinese, I get the following warning, sometimes multiple of them:

`Package polyglossia Warning: Asking to add empty feature to latin font (Language="Chinese" to langtag "") on input line xxx.`

Here is an MRE:

\documentclass{article}

\usepackage{polyglossia}
\setmainlanguage{chinese}
% \setotherlanguage{english}

% load a CJK font, otherwise we get an error
\newfontfamily\cJKfont[Script=CJK]{Noto Serif CJK SC}

\begin{document}
你好

% uncommenting the following line does not produce additional warnings
% \textenglish{hi}

% uncommenting the following three lines produces one additional warning on the
% line with `\end{english}`
% \begin{english}
% hi
% \end{english}

\end{document}

This MRE causes three of the above warnings (once on line with \begin{document} and twice on the one with \end{document}), plus

If I switch it around and use English as the main language and Chinese as the secondary one, I get a single warning per use of \textchinese or the chinese environment, always on the line that switches back out of the Chinese context.

Not sure if this is related to #284?

I am compiling using lualatex (v1.17) and Polyglossia v.1.65.

jspitz commented 8 months ago

Should be fixed in the repo. Please test if you can (exchanging gloss-chinese.ldf suffices)

sievertst commented 8 months ago

That seems to have done the trick, thank you very much!

jspitz commented 8 months ago

Thanks for testing. Let's keep this open until 1.66 is released.

sievertst commented 8 months ago

Sure, sorry for the premature close.