How do I make my fonts available to LuaTeX? - ekassos/swift-book-pdf GitHub Wiki

Where does LuaTeX look for fonts?

The fontspec package uses luaotfload to select fonts. luaotfload scans those directories where fonts are expected to be located on a given system. On a Linux machine it follows the paths listed in the Fontconfig configuration files; consult man 5 fonts.conf for further information. On Windows systems, the standard location is Windows\Fonts, while Mac OS X requires a multitude of paths to be examined. The complete list includes:

  • Windows:
    • % WINDIR%\ Fonts
  • Linux:
    • /usr/local/etc/fonts/fonts.conf
    • /etc/fonts/fonts.conf
  • MacOS:
    • ~/Library/Fonts
    • /Library/Fonts
    • /System/Library/Fonts
    • /Network/Library/Fonts

If a font isn't detected, running luaotfload-tool --update --force may help update the font cache. Fonts are also accessible if found in the TEXMF tree. See the fontspecs package documentation for more details.

Check if a font is available to LuaTeX

If you would like to check that a font is available to LuaTeX, run the following command:

luaotfload v3.29 or later

luaotfload-tool --find="Your Font Name"

luaotfload v3.28 or earlier

There is a bug that affects luaotfload’s query mode in earlier versions. If you run the find command above, you might encounter error:

...4/texmf-dist/tex/luatex/luaotfload/luaotfload-arabic.lua:19: attempt to index a nil value (global 'node')

You should aim to use luaotfload v3.29 or later, but in case you are unable to update luaotfload, download luaotfload-arabic.lua and comment out lines 19-22:

19    -- local node_new = node.direct.new
20    -- local setlink = node.direct.setlink
21    -- local is_char = node.direct.is_char
22    -- local getnext = node.direct.getnext

Place the file into a directory it and run the luaotfload-tool command in that directory. For more information, see this issue on luaotfload’s repository.