3

I'm using XeLaTeX and when calling

\newfontfamily\headingfont{TeX Gyre Pagella Italic}

I get the message

Requested font "TeX Gyre Pagella Italic" at 11.99997pt -> font not found, using "nullfont" 
! Package fontspec Error: The font "TeX Gyre Pagella Italic" cannot be found.

I can see that Windows 10 lists the font as installed, I have the current versions of packages fontspec, libertine, and I refreshed the font map with the MikTeX Console, but it still seems to not be able to find the font.

Below is MWE:

\documentclass[english,a4paper,12pt]{article}
\usepackage{libertine}
\usepackage[bold-style=ISO]{unicode-math}
\newfontfamily\headingfont{TeX Gyre Pagella Italic}
\begin{document}
XX
\end{document}
3

The Pagella family uses "TeX Gyre Pagella" as family name. The italic shape is called "TeXGyrePagella-Italic". In addition, you are not setting a font family but a single font, so it makes more sense to use \newfontface. Overall, the following works for me using TeXLive 2019 on Debian Linux:

\documentclass[english,a4paper,12pt]{article}
\usepackage[bold-style=ISO]{unicode-math}
\newfontface\headingfont{TeXGyrePagella-Italic}
\begin{document}
\headingfont XX
\end{document}
2

The problem is, that xelatex dosen't find the font by name. To fix that, you have to specify the font file:

\documentclass[a4paper,12pt]{article}
\usepackage{libertine}
\usepackage[bold-style=ISO]{unicode-math}
\newfontfamily\headingfont{texgyrepagella-italic.otf}
\begin{document}
  \headingfont XX 
\end{document}

If you run pdffonts you can see, that the right font is used:

name                                     type              encoding         emb sub uni object ID
---------------------------------------- ----------------- ---------------- --- --- --- ---------
SLTSXB+TeXGyrePagella-Italic-Identity-H  CID Type 0C       Identity-H       yes yes yes      5  0
LJPSEU+LinLibertineO-Identity-H          CID Type 0C       Identity-H       yes yes yes      7  0
0

You can try

\newfontface\headingfont{TeXGyrePagella-Italic}

or

\newfontfamily\headingfont{TeX Gyre Pagella}\textit{...}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.