Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!elroy.jpl.nasa.gov!decwrl!adobe!heaven!heaven.woodside.ca.us From: glenn@heaven.woodside.ca.us (Glenn Reid) Newsgroups: comp.lang.postscript Subject: Re: load operator Message-ID: <444@heaven.woodside.ca.us> Date: 2 Mar 91 21:06:10 GMT References: <1991Feb28.151933.8786@cl.cam.ac.uk> Sender: glenn@heaven.woodside.ca.us Lines: 47 In article <1991Feb28.151933.8786@cl.cam.ac.uk> cet1@cl.cam.ac.uk (C.E. Thompson) writes: > In article <436@heaven.woodside.ca.us> Glenn Reid writes: > >Dan Mick writes Dan> >> In other words would you expect this to work: Dan> >> (Times-Roman) load setfont Dan> >> , or does it have to be Dan> >> (Times-Roman) cvn load setfont Glenn> >Yes, the "load" operator works with non-name-type operands. So does Glenn> >the "def" operator, its converse. The following examples are all Glenn> >perfectly legitimate in PostScript: Chris> Every word you say is true, Glenn, but I think you may be misleading the > original poster. Keys in PostScript directories can have any type (although > the case of names is usually optimised), but the type is significant when > matching the key. Thus the user's two examples may both be valid, but > they won't access the same directory entries. If, as one rather suspects, > he has added FontDirectory to the directory stack and is hoping to find > the canonical Times-Roman font, only the second will have the desired effect. I'll certainly admit to the likelihood that I was missing the point and misleading the original poster, but I have to point out that strings and names are in fact equivalent from the dictionary-lookup point of view (as a recent posting indicated, quoting directly from the Red Book that strings are in fact converted to names by the "def" operator, and presumably by the "load" operator as well, since it works). This works fine: FontDirectory begin (Times-Roman) load 12 scalefont setfont But it is certainly not the recommended way to set a font. I can't believe, somehow, that the original poster would have happened upon "load" before discovering "findfont", since almost every single example of PostScript I've even seen uses "findfont", and very few of them use "load". I suspect that there was another motivation for the question. If Dan Mick is still out there reading all this drivel, perhaps he could post again and let us know just what he was really after, and if any of our various followups have helped at all :-) -- Glenn Reid RightBrain Software glenn@heaven.woodside.ca.us NeXT/PostScript developers ..{adobe,next}!heaven!glenn 415-851-1785 (fax 851-1470)