Indexing fonts

Karl Berry karl at freefriends.org
Mon Dec 19 00:20:33 CET 2022


Here is my attempt at rewriting the system font section in the TL manual
to reflect current reality. If any suggestions or comments, let me know.

(Peter: if you're going to refer to this
section, please use the more generically-named anchor
https://tug.org/texlive/doc/texlive-en/texlive-en.html#sysfontconfig.
It's been around for years, I just forgot when I replied before.)

Thanks,
Karl

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\htmlanchor{xetexfontconfig}  % keep historical anchor working
\htmlanchor{sysfontconfig}
\subsubsection{System font configuration for \protect\XeTeX\protect\ and Lua\protect\TeX}
\label{sec:font-conf-sys}

\XeTeX\ and Lua\TeX\ can use any font installed on the system, not just
those in the \TeX\ trees. Such system fonts (not part of \TL) are
usually accessed by giving the font name, e.g., `\code{Liberation
Serif}', although the system filename can also be used.

A related issue is making the fonts from the \TL\ distribution available
as system fonts, which will in turn make them available by font name.

For Lua\LaTeX: for access by font name, nothing special need be done.
All fonts in \TL\ should be equally accessible by either font name or
filename to Lua\LaTeX\ (via the \pkgname{luaotfload} package). The font
name index may need to rebuilt for new fonts, but this is triggered
automatically when trying to load a font which isn't known yet.

For plain Lua\TeX and all \XeTeX\ formats: on Windows, fonts shipped
with \TL\ are automatically made available (by running the
\cmdname{fc-cache} program provided for Windows as part of \TL). On
\MacOSX, supporting font name lookups requires additional steps; please
see the Mac\TeX\ web pages (\url{https://tug.org/mactex}). For other
Unix systems, the procedure is the following.

When the \pkgname{xetex} package is installed (either at initial
installation or later), the necessary configuration file is created in
\filename{TEXMFSYSVAR/fonts/conf/texlive-fontconfig.conf}. To make the
\TL\ fonts available as system fonts,
\begin{enumerate*}
\item Copy that \filename{texlive-fontconfig.conf} file to (typically)
\dirname{/etc/fonts/conf.d/09-texlive.conf}.
\item Run \Ucom{fc-cache -fsv}.
\end{enumerate*}

If you do not have sufficient privileges to carry out the steps above,
or if you want to make the \TL{} fonts available to only one user,
you can do the following:
\begin{enumerate*}
\item Copy the \filename{texlive-fontconfig.conf} file to
      \filename{~/.fonts.conf}, where \filename{~} is your home directory.
\item Run \Ucom{fc-cache -fv}.
\end{enumerate*}

You can run \code{fc-list} to see the names of the available system
fonts. The incantation \code{fc-list : family style file spacing} (all
those arguments are literal strings) shows some generally interesting
information.


More information about the tex-live mailing list.