[XeTeX] Test for font presence

Ron Aaron ron at ronware.org
Tue May 10 10:20:52 CEST 2011

Here's a tested version using 'fc-list'.  It works on kubuntu (and
should work equally well on any *nix, don't know if it would work on
Windows).  Note you need to add "-shell-escape" to the xetex command line:

        \immediate\write18{fc-list "#1">fontcheck.tex}
        \read\fontcheck to \innerfc
            \def\innermacro##1 {%
                {\bf FONT MISSING: #1}

You would invoke this like "\maybefont{Excellent Font}{excellent}", and
it would check for the font named "Excellent Font", and if it did not
find it would create a new macro "\excellent".  So when you invoked it
later "\excellent12 " (to get 12pt "Excellent Font", you would get "FONT
MISSING: Excellent Font" in your document.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/xetex/attachments/20110510/ae5c2ed6/attachment-0001.html>

More information about the XeTeX mailing list