8

I've looked at How do I get a list of all available fonts for luaotfload?, but the answers don't work for me in TeX Live 2013, at least not without LaTeX. This is because there they rely on the file otfl-names.lua under \luatex-cache\generic\names; but in my installations of TeX Live 2013 (ConTeXt scheme), the only directory under \luatex-cache is context, and there is no otfl-names.lua that I can find.

P.S. Following this comment, I also looked for luaotfload-names.lua, but can't find that file either. Do I need to run a program to build it? I looked for mkluatexfontdb but no such command seems to exist.

I tried the following ConTeXt mkiv (LuaTeX) document:

\starttext
\startluacode
myfonts=dofile(fonts.names.path.path)

for i,v in ipairs(myfonts.mappings) do
 tex.print(-2, v.familyname)
 tex.print(', ')
 tex.print(-2, v.fontname)
 tex.print('\\par')
end

\stopluacode
\stoptext

But I get the error:

! LuaTeX error [string "\directlua "]:2: attempt to index field 'path' (a nil value)

Any suggestions would be appreciated.

2 Answers 2

7

If all you need is a list of the registered fonts, you can run

mtxrun --script fonts --list --all

for Context, and

luaotfload-tool --list=*

for Lualatex/Luaotfload (see man 1 luaotfload-tool for details).

If you did not yet build the font indices you will have to do so before running above commands, e.g.

mtxrun --script fonts --reload

and

luaotfload-tool --update
1
  • Depending on you shell, you might have to escape the asterisk like luaotfload-tool --list='*' or luaotfload-tool --list=\*.
    – Mankka
    Commented Feb 14 at 7:55
1

Following these comments, I found a font name database at ~/.texlive2013/texmf-var/luatex-cache/context/.../fonts/data/names.tma

It would still be nice to have a program to generate the list in an easy-to-read format, but this will do for now.

Update:

I received this code from Wolfgang Schuster:

% When you want list of all fonts in the database you can do this with 
% a few macros in your document which are provided for this purpose.

% nofruns=1

\setupbodyfont[10pt]

\starttext

\dolookupfontbyspec{filename=*}

\starttabulate
\dorecurse{\dolookupnoffound}
  {\expanded{\NC \dolookupgetkeyofindex{fontname}{\recurselevel} \EQ \dolookupgetkeyofindex{filename}{\recurselevel} \NC\NR}}
\stoptabulate

\stoptext

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .