[Tex/LaTex] luaotfload: how to use font in current directory

luaotfloadluatex

I'd like to use a font in the current directory with luaotfload. I tried to generate the database:

OSFONTDIR=$PWD mkluatexfontdb

but this gives me endless output of:

$ OSFONTDIR=$PWD mkluatexfontdb

luaotfload | Updating the font names database:
luaotfload | Font names database not found, generating new one.
             This can take several minutes; please be patient.
luaotfload | Updating the font names database:
luaotfload | Font names database not found, generating new one.
             This can take several minutes; please be patient.
luaotfload | Updating the font names database:
...

What can I do do to use a (OTF) font in the current directory with luaotfload?

Best Answer

The OSFONTDIR variable is, I think, not intended to be used like this.

Here's an example using both plain and LaTeX font loading (luaotfload.sty can be \input in plain TeX if you're not using LaTeX):

\documentclass{article}
\usepackage{fontspec}
\begin{document}
\font\1="file:MyriadPro-BlackCond.otf" at 12pt\1 hello
\normalfont normal font
\fontspec{MyriadPro-BlackCond.otf}
hello again
\end{document}

For the fontspec example, it auto-detects that it's a font from the filesystem by the existence of .otf at the end of the name. If this doesn't work for you, I think we'll need to do more debugging in another forum (the lualatex-dev mailing list would be a good idea).

Related Question