I recently covered some of the details for running fontspec under LuaTeX.

As development continues while TeX Live 2010 is still under development, many details are still subject to change. In fact, I overlooked a recent feature of luaotfload that simplifies the whole process significantly.

I mentioned that before typesetting for the first time, and after installing fonts, it was necessary to execute the mkluatexfontdb script to keep the font cache database up to date. This will be configured in TeX Live 2010 to perform transparently by the luaotfload package. When a font is loaded that is not in the font cache, the script will be re-executed to check for added fonts. This brings the behaviour of font loading under LuaTeX much closer to that of how XeTeX functions.

The only downside for this approach is that the very first time that fontspec attempts to load a font, the LuaLaTeX compilation will pause for (up to) several minutes while the font cache is initialised. Subsequent compilations will not be affected.

Finally, users will still be able to execute mkluatexfontdb manually for debugging purposes (e.g., with the -vvv option). In Mac OS X, the LastResort.ttf font causes problems when attempted to be loaded by LuaTeX, and we explicitly ignore it; it’s quite plausible there will be other such problematic fonts on other platforms that we need to deal with.