I'm trying to use LuaTeX with Adobe's Garamond Premier Pro, but it doesn't work, saying that:
! error: (type 0): cannot find file ''
! ==> Fatal error occurred, no output PDF file produced!
while XeTeX compiles fine.
I managed to narrow down the issue to the following code:
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Garamond Premier Pro}
\begin{document}
hello
\end{document}
I'm using TeXLive 2018.
Following Ulrike's suggestion, I changed the font name by the file name:
\documentclass{article}
\usepackage{fontspec}
% \setmainfont{Garamond Premier Pro}
\setmainfont{GaramondPremrPro.otf}
\begin{document}
hello
\end{document}
this didn't work as well :/
So I tried copying GaramondPremrPro.otf
from the installed directory ($HOME/.local/share/fonts/
) to the current directory, then it worked (it also works if I put them in a directory in the texmf tree). So I guess that the problem is with Ubuntu's font directory...
Addendum: Something I think it's odd...
Suppose I have only the file GaramondPremrPro.otf
in the current directory and call the font by the file name:
\documentclass{article}
\usepackage{fontspec}
% \setmainfont{Garamond Premier Pro}
\setmainfont{GaramondPremrPro.otf}
\begin{document}
hello
\bfseries
hello
\end{document}
I get a only font substitution warning because LaTeX couldn't find the bold font file:
LaTeX Font Warning: Font shape `TU/GaramondPremrPro.otf(0)/bx/n' undefined
(Font) using `TU/GaramondPremrPro.otf(0)/m/n' instead on input line 7.
However, if I call the font by its name:
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Garamond Premier Pro}
% \setmainfont{GaramondPremrPro.otf}
\begin{document}
hello
\bfseries
hello
\end{document}
I get the cryptic cannot find file ''
from above.
If I remove the \bfseries
instruction, both versions work.
\setmainfont{xxx.otf}
)?\setmainfont{Garamond Premier Pro}[Path = $HOME/.local/share/fonts/]
?