Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!intercon!amanda@intercon.UUCP From: amanda@intercon.UUCP (Amanda Walker) Newsgroups: comp.lang.postscript Subject: Important safety tip Keywords: Chernobyl fonts Message-ID: <13-Jun-89.091841@192.41.214.2> Date: 13 Jun 89 13:07:11 GMT Sender: news@intercon.UUCP Reply-To: amanda@intercon.UUCP (Amanda Walker) Organization: InterCon Systems Corporation Lines: 44 It seems user defined fonts (FontType 3) are a little more magical than they appear. Consider the following piece of PostScript code: -------------------------- 8 dict begin /FontType 3 def /FontMatrix [.001 0 0 .001 0 0] def /FontBBox [0 0 1000 1000] def /BaseFont /Courier findfont [800 0 0 1000 0 0] makefont def /Encoding 256 array def StandardEncoding Encoding copy /String 1 string def /StrokeWidth 40 def /BuildChar { exch begin BaseFont setfont String exch 0 exch put String stringwidth StrokeWidth setlinewidth 1 setlinecap newpath 0 0 moveto String false charpath pathbbox setcachedevice newpath 0 0 moveto String false charpath stroke end } def currentdict end /Courier-Compressed exch definefont pop -------------------------- This creates a font that is based on Courier, but is compressed by 80% horizontally, and with the stroke weight beefed up a little. Pretty simple, right? Intending to keep this font as small as possible, I tried removing the definition for /Encoding, but definefont objected. So, I tried "/Encoding [] def" instead, since I don't actually use the encoding vector for anything. "definefont" took it, but when I tried to show some text with it, my LaserWriter sent back "Fatal System Error at 0Xnnnnn" where nnnnn is a hexadecimal number I didn't write down, and then promptly rebooted itself. Is this a known bug in PostScript 38.0? -- Amanda Walker -- "Some of the worst mistakes in history have resulted from trying to apply methods that work fine in one field to another where they don't." -James Hogan