![](https://secure.gravatar.com/avatar/adfff96f4299fb3ee3b199b06eea68da.jpg?s=120&d=mm&r=g)
Patches item #864, was opened at 2007-09-17 17:49 You can respond by visiting: http://sarovar.org/tracker/?func=detail&atid=495&aid=864&group_id=106 Category: Primitives Group: v1.50.0 Status: Open Resolution: Accepted Priority: 5 Submitted By: Taco Hoekwater (taco) Assigned to: Martin Schröder (oneiros) Summary: \suppressfontnotfounderror patch Initial Comment: Attached is a patch for pdftex 1.50 (current trunk) that introduces a new integer parameter named \suppressfontnotfounderror. If this parameter is non-zero, then (pdf)tex will not complain about font metric files that are not found, but silently skip the font assignment, making the requested csname \ifx-equal to \nullfont. The purpose is to allow macro programmers a way to gracefully recover from a missing or differently named font. I am aware there is a trick that uses \batchmode to test for font existance, but the downside of that is that it calls TeX's error() routine, which clobbers the executable's return value. That makes it a no-no in "make"-like environments where the return value of TeX is checked to decide on further actions. This functionality will also be added to the next versions of xetex and luatex (that's why the name does not start with \pdf...). % simple example usage \def\testfont#1{% \font\junk=#1 \ifx\junk\nullfont \message{Font #1 not found} \else \message{Font #1 found} \fi } {\suppressfontnotfounderror=1 \testfont{cmr-junk} } \bye ----------------------------------------------------------------------
Comment By: Taco Hoekwater (taco) Date: 2007-09-18 08:10
Message: Logged In: YES user_id=1608 Well, at least it does not affect the tex user directly: there is a stream of garbage on the screen and that looks ugly, but there is no error interaction, and the system-level return value of pdftex is unaffected. I don't know if there is a clean way to control mktextfm cs, but if it can be done, that would be a nice addition to the web2c change file. ---------------------------------------------------------------------- Comment By: Martin Schröder (oneiros) Date: 2007-09-17 21:53 Message: Logged In: YES user_id=421 IMHO it works only somuch, but that may be due to kpathsea:
pdftex test.tex This is pdfTeX, Version 3.141592-1.50.0-alpha-20070917 (Web2C 7.5.6) entering extended mode (./test.texkpathsea: Running mktextfm cmr-junk mktextfm: Running mf-nowin -progname=mf \mode:=lexmarkr; mag:=1; nonstopmode; input cmr-junk This is METAFONT, Version 2.71828 (Web2C 7.5.4)
kpathsea: Running mktexmf cmr-junk ! I can't find file `cmr-junk'. <*> ...xmarkr; mag:=1; nonstopmode; input cmr-junk Please type another input file name ! Emergency stop. <*> ...xmarkr; mag:=1; nonstopmode; input cmr-junk Transcript written on mfput.log. grep: cmr-junk.log: Datei oder Verzeichnis nicht gefunden mktextfm: `mf-nowin -progname=mf \mode:=lexmarkr; mag:=1; nonstopmode; input cmr-junk' failed to make cmr-junk.tfm. kpathsea: Appending font creation commands to missfont.log. Font cmr-junk not found ) No pages of output. Transcript written on test.log. ---------------------------------------------------------------------- You can respond by visiting: http://sarovar.org/tracker/?func=detail&atid=495&aid=864&group_id=106