🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #93

unloading fonts (Re: FAQ...[1-4 of 12])

#93
From: Dick Dunn
Date: Sun, 01 Nov 1992 08:09
42 lines
2715 bytes
from the first section of the new FAQ:
>Subject: 2.4 How do I remove a persistent (``permanent'') downloaded font? 
>
>    One trick for removing a persistent font (this requires that you 
>    knew you would need to remove it before you downloaded it) is to 
>    issue a ``serverdict begin 0 exitserver /magic-cookie save def'' 
>    before downloading and sending ``serverdict begin 0 exitserver 
>    magic-cookie restore'' when you want to reclaim all VM used since 
>    the first download...

This is a bad idea.  It won't work at all in Level 2 (see below), and it
may or may not work in Level 1.  There's a good chance it will surprise the
server-loop code in your printer and produce results that are entertaining
at best...the server loop may have some implicit assumptions that it's
running at save level 0.  There's no explicit guarantee that save-restore
pairs will work at all in separate exitserver-context jobs in Level 1.

>...The downside of this is that is uses up a save 
>    level, but this is usually not a problem. 

This "trick" modifies the global state of the printer--something that lasts
across print jobs.  Somehow "usually not a problem" isn't very satisfying
in this context!  You risk causing a print job to fail (if it uses all the
save levels) just because it happens to get run within the global save-
restore pair...so don't try this on a shared printer.

Moreover, the trick only works once (allowing "unloading" of one group of
fonts) unless you want to go way further out on the limb by consuming more
save levels.  Remember that you can "unload" *all* downloaded fonts using
the "quit" operator (described elsewhere in the FAQ), so the trick is
really of limited usefulness in addition to being likely to cause problems.

Nor will it work in Level 2, because
	"if the [unencapsulated] job ends with one or more saves pending, a
	restore to the outermost saved VM is performed automatically."
[Big Red, p.70]
but of course, it's not needed in Level 2 because you can remove downloaded
fonts selectively with an unencapsulated job using the appropriate
undefinefont (or /Font undefineresource) sequence.
-- 
Dick Dunn    rcd@raven.eklektix.com   -or-   raven!rcd    Boulder, Colorado
	...Simpler is better.
Technical Details
Message-ID: <1992Nov1.080932@eklektix.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!wupost!uwm.edu!caen!hellgate.utah.edu!csn!raven!rcd
References: <1992Oct29.203929.24694@cs.brown.edu>

Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.postscript
Path: arc1-ca.pugleaf.net!sparky!uunet!wupost!uwm.edu!caen!hellgate.utah.edu!csn!raven!rcd
From: rcd@raven.eklektix.com (Dick Dunn)
Subject: unloading fonts (Re: FAQ...[1-4 of 12])
Message-ID: <1992Nov1.080932@eklektix.com>
Summary: Don't try this except at home
Organization: eklektix - Boulder, Colorado
References: <1992Oct29.203929.24694@cs.brown.edu>
Date: Sun, 1 Nov 1992 08:09:32 GMT
Lines: 42