[Tex/LaTex] luatex cannot find font metric data

fontsluatexopentypetexlivexetex

After installing TeX Live 2012 in a non system directory (not sure if this makes a difference) and running some of the tests found at TeX Live Install, LuaTeX can't find the example font metrics even though xetex can.

$ luatex opentype-info.tex 
This is LuaTeX, Version beta-0.70.2-2012062812 (TeX Live 2012)
 restricted \write18 enabled.
(./opentype-info.tex
! Font \testfont=Latin Modern Roman/ICU at 12pt not loadable: metric data not found or bad.
<to be read again> 
                   \par 
l.27 

? X
No pages of output.
Transcript written on opentype-info.log.
$ xetex opentype-info.tex 
This is XeTeX, Version 3.1415926-2.4-0.9998 (TeX Live 2012)
 restricted \write18 enabled.
entering extended mode
(./opentype-info.tex [1] )
Output written on opentype-info.pdf (1 page).
Transcript written on opentype-info.log.
$ 

How can I fix my LuaTeX install?

Best Answer

The Web page you refer (Testing the installation) is indeed not very informative about LuaTeX.

It's not really possible to test fonts with opentype-info.tex by two reasons:

  1. the file doesn't enable the font loading mechanism for LuaTeX;
  2. it has specific XeTeX commands that LuaTeX can't understand.

A small test file might be

\def\myfontname{Latin Modern Roman} % <- change here

\input luaotfload.sty

\font\testfont="\myfontname" at 12pt
\testfont

Some text: the quick brown fox jumps over the lazy dog

\bye