3

I am using xelatex.exe and need to iterate through the list of fonts installed on my Windows 7 machine. The following code is not complete because I have no idea what is the name that contains the list.

\documentclass{article}
\usepackage[active,tightpage]{preview}
\setlength\PreviewBorder{1pt}
%\PreviewEnvironment{}

\usepackage{etoolbox}

\def\myInstalledFonts{}
\begingroup
\renewcommand\<what should I put here>[<what should I put here>]{%
  \listgadd{\myInstalledFonts}{#2}%
  }
\input{<what should I put here>.def}
\endgroup

\usepackage{fontspec}

\def\do#1{%
    \setmainfont{#1}
        \begin{preview}
    I can find a tool to convert PDF to EPS
    in my neither bathroom nor kitchen.\par
        \end{preview}
}%

\begin{document}

\dolistloop{\myInstalledFonts}

\end{document}

How to iterate through the list of installed fonts?

1 Answer 1

3

I think you will have to get the list externally, e.g. with fc-list : file, and then process it. With lualatex you can read otfl-names.lua, see e.g. Lualatex: Font table with examples.

You must log in to answer this question.

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