fontspec icon indicating copy to clipboard operation
fontspec copied to clipboard

Can't use .fontspec files with math fonts

Open Derek61 opened this issue 7 years ago • 0 comments

(Apologies if this should be filed under the unicode-math project.) I'm trying to use a .fontspec file for a math font. For example, I start with this:

\documentclass{article}
\usepackage{unicode-math}
\setmathfont{texgyrepagella-math.otf}
\begin{document}
  $\alpha$
\end{document}

I create a file TeXGyrePagellaMath.fontspec containing

\defaultfontfeatures[TeX Gyre Pagella Math]
  {
    Extension = .otf,
    UprightFont = texgyrepagella-math
  }

(UprightFont seems like the wrong name, but I'm not sure what to use.) I replace \setmathfont{...} with \setmathfont{TeX Gyre Pagella Math}. When I compile, I get this error:

(.../TeXGyrePagellaMath.fontspec)kpathsea:make_tex: Invalid filename
`[TeX Gyre Pagella Math.otf]/OT', contains '['
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! fontspec error: "font-not-found"
! 
! The font "TeX Gyre Pagella Math" cannot be found.
...

See also https://tex.stackexchange.com/questions/437855/use-separate-fontname-fontspec-file-with-unicode-math

Derek61 avatar Aug 21 '18 20:08 Derek61