Is it possible to have OpenType fonts with LuaTeX using the plain format?
I have tried:
\font\test="texgyrepagellaregular"\test test\bye
but I get ! Font \test=texgyrepagellaregular not loadable: metric data not found or bad.
.
mtxrun --script fonts --list --all --pattern=pagella
shows the above font name when I followed the instructions at http://wiki.contextgarden.net/Fonts_in_LuaTeX.
But on actually using the fonts, the page switches to speaking of ConTeXt instead of LuaTeX, which leaves me to wonder if it is possible to use OT-fonts with plain?
UPDATE
Even though this now works fine for fonts which are located in my home directory (OSX Lion, BasicTeX2012, luatex-plain
-format constructed as instructed below), I am unable to use fonts which are located in the system directories. So while the above example works (with texgyrepagellaregular
), as the mtxrun
-script shows its location as ~/Library/Fonts
, the following doesn't:
\font\test="minionproregular"
presumably because mtxrun
shows its location as /Library/Fonts
(the same issue seems to be with fonts inside /System/Library/Fonts
).
Now, I added to my ~/.zshrc
:
export OSFONTDIR=/System/Library/Fonts:/Library/Fonts:$OSFONTDIR
after which I was able to update the fonts database with mtxrun --script fonts --reload
(following these instructions), and indeed now the mtxrun
listing does show all of the fonts. It's just that luatex-plain
doesn't see them.
How can I make luatex-plain
see the fonts mtxrun
sees?
Best Answer
Let me add to the confusion a bit: there are actually two formats for running Plain with LuaTeX! One of them is the format that gets called when you run the command
luatex
from e.g. TeX Live; egreg already posted instructions for it in his answer.There exists, however, another format called luatex-plain. Since it comes with the font loader built in, it has the advantage of being able to use OpenType fonts without additional packages. Here’s a demo (you’ll need the free Minion Pro fonts from Adobe for the second part):
For more complicated examples see the test file.
luatex-plain is distributed with ConTeXt and available through TeX Live in the directory
texmf-dist/tex/generic/context/luatex/
. (Pro Tip: build the format and then symlink theluatex
binary toluatex-plain
, so you don’t have to specify the--fmt
parameter.)