latex3 / fontspec

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

Font cannot be found on Windows 10 for local user #424

Closed asteppke closed 4 years ago

asteppke commented 4 years ago

Description

With the current TeXLive 2020 on Windows 10 I was trying to compile a MWE document

\documentclass{article}
\usepackage{fontspec}

\setmainfont{Helvetica World}

\begin{document}
    test $a + b = c$
\end{document}

but whatever I did LuaTeX could not find the font (emptying caches, regenerating, ...). It turns out that Windows without giving you a lot of feedback is installing fonts in C:\Users\<Username>\AppData\Local\Microsoft\Windows\Fonts instead of C:\Windows\Fonts if not explicitly told to do so. All other programs handle this change transparently, i.e. the font is simply available for this user. Unfortunately LuaTeX does not seem to search this directory and only states that the font cannot be found.

It would be helpful if LuaTeX/fontspec would include this directory when searching for fonts, especially for installations under Windows for users without administrative rights (portable, etc.).

Check/indicate

Further details

u-fischer commented 4 years ago

This is not a fontspec problem, but should be reported at the luaotfload tracker.

But beside this: We added support for local directories a few months ago https://github.com/latex3/luaotfload/issues/138 and on my system it works fine. I just tried with a font and lualatex used it without problems:

..../AppData/Local/Microsoft/Windows/Fonts/Andika-R.ttf

Which luaotfload version are you using?

asteppke commented 4 years ago

@u-fischer: I was not aware that luaotfload is doing the lifting behind the scenes as I was only loading fontspec and looking at its error message.

I checked my installation and luaotfload --version returns "v3.12/2020-02-02", so it looks like this is fixed in 3.13 already and I just have to update. Fantastic and thank you!