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:
\newif\iffontexists
\newread\fontcheck
\def\fontexist#1{
\fontexiststrue
\immediate\write18{fc-list "#1">fontcheck.tex}
\immediate\openin\fontcheck="fontcheck.tex"
\read\fontcheck to \innerfc
\ifnum\strcmp{\innerfc}{\par}=0
\fontexistsfalse
\fi
\closein\fontcheck
}
\def\maybefont#1#2{%
\fontexist{#1}
\iffontexists\else
\def\innermacro##1 {%
{\bf FONT MISSING: #1}
}
\csname#2\endcsname
\expandafter\let\csname#2\endcsname=\innermacro
\fi
}
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.
--------------------------------------------------
Subscriptions, Archive, and List information, etc.:
http://tug.org/mailman/listinfo/xetex