Taco Hoekwater wrote:
Or you could do something like this:
\def\doiffontelse#1#2#3{% \batchmode \font\klutch=#1 \errorstopmode \ifdim \the\fontdimen5\klutch < 1pt #3\else #2\fi \let\klutch\relax }
\doiffontelse{ec-lmr10} {\message{Up-to-date}} {\message{Please install lmr}}
It gives an ugly error in the log file if the font is not found, but that is a only a minor inconvenience.
I remember that long ago taco and i had some discussion about testing stuff in font-ini, here is a residu, still in font-ini.tex: %D Some unused left||overs: %D %D \starttyping %D \def\doiffontpresentelse#1#2#3% %D {\bgroup %D \batchmode\font\dummy=\truefontname{#1}\errorstopmode %D \edef\lastfontname{\fontname\dummy}% %D \ifx\lastfontname\nullfontname\egroup#3\else\egroup#2\fi} %D %D \def\abortiffontnotfound#1% %D {\doiffontpresentelse{#1}{}{\showmessage\m!fonts{10}{\truefontname{#1}}\endinput}} %D \stoptyping a more modern definition is: \def\doiffontpresentelse#1% {\bgroup \batchmode\font\dummy=\truefontname{#1}\errorstopmode \edef\lastfontname{\fontname\dummy}% \ifx\lastfontname\nullfontname \egroup\expandafter\secondoftwoarguments \else \egroup\expandafter\firstoftwoarguments \fi} and more etex is: \def\doiffontpresentelse#1% {\bgroup \scratchcounter\interactionmode \batchmode \font\dummy=\truefontname{#1}\relax \interactionmode\scratchcounter \edef\lastfontname{\fontname\dummy}% \ifx\lastfontname\nullfontname \egroup\expandafter\secondoftwoarguments \else \egroup\expandafter\firstoftwoarguments \fi} thsi works ok with: \doiffontpresentelse{texnansi-lmr10}{YES}{NO} \doiffontpresentelse{adam-lindsay-modern-serif}{YES}{NO} i'll add them (again) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------