latex3 / fontspec

Font selection in LaTeX for XeTeX and LuaTeX
http://latex3.github.io/fontspec/
LaTeX Project Public License v1.3c
277 stars 34 forks source link

explicit extension does not work in .fontspec files #480

Closed kberry closed 7 months ago

kberry commented 2 years ago

According to the "By file name" section in the documentation, and historical practice since the invention of .fontspec files, giving explicit extensions on font variants is supposed to be equivalent to giving the Extension variable. For example, these should be the same:

\defaultfontfeatures[MyCharis]
  {
    UprightFont = CharisSIL-Regular.ttf,
  }

\defaultfontfeatures[MyCharis] { Extension = .ttf, UprightFont = CharisSIL-Regular, }


Unfortunately, the former, with the explicit .ttf on UprightFont, no longer works. Minimal input file:

\documentclass{article} \usepackage{fontspec} \setmainfont{MyCharis} \begin{document} Hi. \end{document}


gets error message:

! Package fontspec Error: The font "CharisSIL-Regular.ttf" cannot be found.



Whereas the second .fontspec, with "Extension = .ttf", works.

Hope it can be fixed. Thanks.
niruvt commented 1 year ago

This still is persistent. See: https://tex.stackexchange.com/q/675081

I hope it gets some attention from the developers.

wspr commented 7 months ago

Many apologies this has lingered so long. It should now be fixed for the next release of the package.

kberry commented 7 months ago

Thanks Will!