Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
    
looks like a problem with luaotfload, please report at github.com/khaledhosny/luaotfload/issues –  Philipp Jan 30 '11 at 19:55
    
also, luaotfload allows specifying fonts by file name. –  Philipp Jan 30 '11 at 19:58

2 Answers 2

up vote 2 down vote accepted

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).

share|improve this answer
    
No, it does not work (the plain TeX variant): Font \jss=file:JosefinSansStd-Light.otf at 12pt not loadable: metric data not found or bad. The LaTeX variant does not give me an error message but does not switch to the font either. –  topskip Jan 31 '11 at 6:36
    
With \fontspec[Path=/my/current/dir]{...} I get the same metric data not found-error. –  topskip Jan 31 '11 at 6:54
    
@Patrick — seems like a problem somewhere. Not sure if we can resolve this here. (I've edited my answer above.) –  Will Robertson Jan 31 '11 at 7:37
    
I will investigate further and see what I can do to track down the problem. –  topskip Jan 31 '11 at 7:43
    
it works now. Thanks (also to @Khaled Hosny) –  topskip Mar 22 '11 at 10:12

This should work:

\input luaotfload.sty
\directlua{fonts.names.scan(".")}
\font\test={name:Gota Light} % whatever the font is
\test test
\bye

But it does not work now because of a long undiscovered bug (you can fix it by replacing "zapfino" with dir in the file otfl-font-nms.lua.)

Fontspec's ExternalLocation would be extended to use this feature.

share|improve this answer
    
A fixed version have been uploaded to CTAN and is available in texlive now. –  Khaled Hosny Feb 5 '11 at 23:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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