Closed tomaszgrabowskiop closed 1 year ago
Is this probably related to #566 (and fixed by the commit that resolved that issue)?
I will try to check it out.
Important info (observed by jperon), "loading polyglossia before using \setmainfont raises the error, but loading it after does work."
It means you have to call package fontspec ealier too.
\documentclass{article}
\usepackage{fontspec}
\usepackage[pass-fonts]{lyluatex}
\setmainfont{Minion Pro}
\usepackage{polyglossia}
\begin{document}
\lily{
\fixed c'{c d e f}
\addlyrics{c d e f}
}
\end{document}
I don’t know whether it’s related to #566, but here are more details about this error. It seems that using \setmainfont
after loading polyglossia
alters fonts.hashes.identifiers
. This MWE will show that:
\documentclass{minimal}
\usepackage{fontspec}
\setmainfont{Linux Libertine O}
\directlua{without = type(font.getfont(font.current()).shared.rawdata)}
\usepackage{polyglossia}
\directlua{before = type(font.getfont(font.current()).shared.rawdata)}
\setmainfont{Linux Libertine O}
\directlua{after = type(font.getfont(font.current()).shared.rawdata)}
\begin{document}
Without polyglossia: \directlua{tex.sprint(without)}
Before setmainfont: \directlua{tex.sprint(before)}
After setmainfont: \directlua{tex.sprint(after)}
\end{document}
What probably is the culprit here are the fontfamily patchings polyglossia
makes. I have no idea how we could avoid that.
So far as lyluatex
is concerned, if you know another way to get the font family name I get from
font.getfont(font.current()).shared.rawdata.metadata['familyname']
, I could fix this precise issue on my side.
@dohyunkim is much more versed in things lua than I am. Thus inviting.
After searching a bit, I found that font.getfont(font.current()).fullname
, which works with polyglossia
, gives the info. I’ll go with it.
Good.
Using Polyglossia and LyLuaTeX package is not possible if you want to use fonts set in LaTeX document.
Such code reports error massage and will not pass fonts (either local or system installed).
Using only package fontspec causes no error and allows to pass fonts. I don't know where to report it. I ask @jperon (creator of lyLuaTeX) to look into it aswell.
Error massage: