Closed cabohah closed 3 months ago
It's an issue with the Harfbuzz renderer rather than polyglossia
. You can reproduce without polyglossia
:
\documentclass{book}
\usepackage{fontspec}
\setmainfont[Ligatures=TeX,Renderer=Harfbuzz]{TeX Gyre Termes}
\begin{document}
\slshape
This is a sentence.
\end{document}
The problem is caused by the fact that polyglossia
uses the HarfBuzz
renderer by default. So I'm not sure this is a polyglossia
problem. It's really a fontspec
problem:
\documentclass{book}
\usepackage{fontspec}
\setmainfont[Ligatures=TeX,Renderer=HarfBuzz]{TeX Gyre Termes}
\begin{document}
This is a sentence.
\end{document}
You can change the default renderer with the luatexrenderer
option of the package, FWIW.
It is not really class dependent, I don't think. The difference between article
and book
is probably in what they do at \begin{document}
.
\documentclass{article}
\usepackage{fontspec}
\setmainfont[Ligatures=TeX,Renderer=Harfbuzz]{TeX Gyre Termes}
\begin{document}
\slshape
This is a sentence.
\end{document}
also reproduces.
It's also class dependent, because this example works for me with
article
orreport
class.
Not if you add, e.g., \slshape
into an example using article
or report
.
This is a bug in luaotfload
, I've reported it in https://github.com/latex3/luaotfload/issues/285.
I'm closing this ticket, but feel free to reopen it if you think my analyze is wrong.
It seems, that
polyglossia
breaks fonts names with whitespaces when using LuaLaTeX andfontspec
, e.g.:results in:
So it seems, that the font name is
TeX
.A workaround would be to load
polyglossia
after\setmainfont
or to useTeXGyreTermes
(without spaces) as font name.There error does not occur with XeLaTeX instead of LuaLaTeX.
See also https://tex.stackexchange.com/q/721772/277964.
I'm not absolutely sure, that this is a
polyglossia
issue, but because the error does not occur withoutpolyglossia
or when usingbabel
instead ofpolyglossia
, I report it here.