Dear Devs,
after a long time I resumed my old project and got this compilation error:
! Package polyglossia Error: The current roman font does not contain the Greek
script!
(polyglossia) Please define \greekfont with \newfontfamily.
See the polyglossia package documentation for explanation.
Type H <return> for immediate help.
...
l.7 \select@language {greek}
It's a completely new error, but I can't say when it came, because I hadn't touched this project for months and months.
This is a MWE which has the same error:
% !TeX program = xelatex
% !TeX encoding = UTF-8
% !TeX spellcheck = it_IT
\documentclass[a4paper]{book}
%\usepackage[osf]{libertinus}
\usepackage{fontspec}
%\usepackage{unicode-math}
\setmainfont[Ligatures=TeX,Numbers=OldStyle]{Libertinus Serif}
%\setmonofont[Scale=MatchLowercase]{Libertinus Mono}
%\setmathfont[Scale=MatchUppercase]{Libertinus Math}
\usepackage{polyglossia}
\setmainlanguage[babelshorthands=true]{italian}
\setotherlanguage[variant=ancient]{greek}
\usepackage{realscripts}
\begin{document}
ljklklkj
ἀἀἄ
\begin{greek}
ἀἀἄ
\end{greek}
\end{document}
Using \usepackage[osf]{libertinus} instead of fontspec solves the issue, but I would like to know the reason for this new behavior. Is it a bug or a new feature?
Best wishes and thank you so much for developing this excellent font.
I don’t get any warning here.
Can you add \XeTeXtracingfonts=1 on the top of your file, then check the log file for Requested font "Libertinus Serif" lines to see what actual font files you are ending up with, might be an outdated or somehow defective copy.
It's very strange... Here is the log:
(/usr/local/texlive/2019/texmf-dist/tex/latex/unicode-math/unicode-math-table.t
ex)))
Requested font "Libertinus Serif" at 9.99997pt
-> /usr/local/texlive/2019/texmf-dist/fonts/type1/public/libertinus-type1/Libe
rtinusSerif-Regular.pfb
Requested font "Libertinus Serif/OT" at 10.0pt
-> /usr/local/texlive/2019/texmf-dist/fonts/type1/public/libertinus-type1/Libe
rtinusSerif-Regular.pfb
...
LaTeX Info: Redefining \rmfamily on input line 13.
Requested font "Libertinus Serif" at 9.99997pt
-> /usr/local/texlive/2019/texmf-dist/fonts/type1/public/libertinus-type1/Libe
rtinusSerif-Regular.pfb
Requested font "Libertinus Serif/OT" at 10.0pt
-> /usr/local/texlive/2019/texmf-dist/fonts/type1/public/libertinus-type1/Libe
rtinusSerif-Regular.pfb
Why is it calling pfb fonts???
Apparently you made your TeX Live font dirs seen by FontConfig, and when faced will multiple versions of the same font it will pick one at random. Unless you really want the Type 1 fonts visible to FontConfig, I suggest you change your configuration to only expose opentype and teuetype dirs.
Ah, yes!
I forgot to remove third line in /etc/fonts/conf.d/09-texlive.conf. :-D
Perfect! Now it works very well!
At this point, I ask you for advice: would you suggest loading your font via fontspec or via libertinus-otf?
I’m not very familiar with libertinus-otf package, but I assume it is basically the same as loading with fontspec plus some convenience options.