🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #586

Re: Important safety tip

#586
From: Glenn Reid
Date: Tue, 13 Jun 1989 21:57
50 lines
2823 bytes
In article <13-Jun-89.091841@192.41.214.2> amanda@intercon.UUCP (Amanda Walker) writes:
>It seems user defined fonts (FontType 3) are a little more magical than they
>appear.  Consider the following piece of PostScript code:

 [font deleted]

>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?

No, it is a bug in your program.  You must have an Encoding vector of
256 elements or you can't print characters.  The fact that "definefont"
allowed you to have a null encoding is a slightly relaxed approach, and
you should not count on it working in the future (or even in the
present).

Well, to be fair, it is also a bug in PostScript 38.0, since it should
never crash with a Fatal System Error :-)

If you don't care about the Encoding, you should just do this:

	/Encoding StandardEncoding def

Since "StandardEncoding" is already defined, you end up using the
same amount (or less) memory than if you had done /Encoding [] def.
In truth, you do care about the encoding, because Courier cares about
the encoding, and you are using Courier.  You should just copy the
Encoding along with the rest of the font, and not make an exception of
it.  It looks like you were borrowing code from a re-encoding
algorithm, which naturally allocates a new encoding array, but I don't
think you need to do that in your case.  Just copy it in the "forall"
loop along with the rest of the font (except FID).

Also, there is nothing really magical about user-defined fonts.  You in
fact basically still have a Type 1 font, despite the fact that you
changed its type to 3 (since you use all the same character
definitions).  In fact, maybe you should leave the FontType to be 1.

I hope this helps.

Glenn Reid
Adobe Systems
Technical Details
Message-ID: <906@adobe.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!adobe!greid
References: <13-Jun-89.091841@192.41.214.2>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!adobe!greid
From: greid@adobe.com (Glenn Reid)
Newsgroups: comp.lang.postscript
Subject: Re: Important safety tip
Keywords: Chernobyl fonts
Message-ID: <906@adobe.UUCP>
Date: 13 Jun 89 21:57:02 GMT
References: <13-Jun-89.091841@192.41.214.2>
Sender: news@adobe.COM
Reply-To: greid@adobe.COM (Glenn Reid)
Organization: Adobe Systems Incorporated, Mountain View
Lines: 50