khaledhosny / luaotfload

Moved to https://github.com/latex3/luaotfload
23 stars 15 forks source link

Can't load font by filename #38

Closed pgundlach closed 13 years ago

pgundlach commented 13 years ago

If I understand the manual, this should load a font and display it:

\input luaotfload.sty

\font\test=/pub/fonts/G/GaramondPremierPro/GaramondPremrPro-Med.otf at 11pt
\test 
Sphinx of black quartz, judge my vow.

\bye

but instead I get

luaotfload | Font names database saved: %s 
: /Users/patrick/.texlive2011/texmf
-var/luatex-cache/generic/names/otfl-names.lua
! Font \test=/pub/fonts/G/GaramondPremierPro/GaramondPremrPro-Med.otf at 11pt n
ot loadable: metric data not found or bad.
<to be read again> 
                   \test 
l.4 \test

I expected to get the font loaded and used by LuaTeX. Some version info:

~/TeX/luatex/test$ luatex test
This is LuaTeX, Version beta-0.70.1-2011062107 (rev 4277) 
 restricted \write18 enabled.
(./test.tex (/opt/texlive2011/texmf-dist/tex/luatex/luaotfload/luaotfload.sty
(/opt/texlive2011/texmf-dist/tex/luatex/luatexbase/luatexbase.sty
Package: luatexbase 2010/10/06 v0.3 Module utilities for LuaTeX
...

and

(/opt/texlive2011/texmf-dist/tex/luatex/luaotfload/luaotfload.lua)
Lua module: luaotfload 2011/04/21 1.25 OpenType layout system.
wspr commented 13 years ago

This is an area where the interface has occasionally changed, if I recall correctly. Does it work to write

\font\test={file:/pub/fonts/G/GaramondPremierPro/GaramondPremrPro-Med.otf} at 11pt

instead? (The braces aren't necessary but not a bad idea.)

pgundlach commented 13 years ago

That works, thanks! Then the bug is in the documentation, right?

wspr commented 13 years ago

Yes, best to keep this issue open to remind us to fix the docs! Thanks for spotting this.

khaledhosny commented 13 years ago

It is more of a bug in the code (the fallback is not working as it should), but I'll just call it a feature and change the documentation.