Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!ucsd!ucbvax!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!cam-cl!news From: cet1@cl.cam.ac.uk (C.E. Thompson) Newsgroups: comp.lang.postscript Subject: Re: UniqueId in Font Dictionaries: Why? Message-ID: <1990Nov26.174933.24043@cl.cam.ac.uk> Date: 26 Nov 90 17:49:33 GMT References: <90327.103524SMITHM@QUCDN.QueensU.CA> Reply-To: cet1@cl.cam.ac.uk (C.E. Thompson) Organization: U of Cambridge Comp Lab, UK Lines: 52 In article <90327.103524SMITHM@QUCDN.QueensU.CA> SMITHM@QUCDN.QueensU.CA writes: >I've now listed the UniqueIDs on two printers, one with Adobe fonts >and one with Imagen (UltraScript) fonts. At the risk of embarassing myself >further, I'd still like to know how UniqueID is used. The Green Book >program assumes that it is generating a unique ID by adding 1 to the >base font's ID. This is true for the font in the example (Helvetica-Bold). >It wouldn't work for Century Schoolbook Bold Italic because its ID is one >less than Century Schoolbook Bold. I haven't got the Green Book to hand, but there are similar constructions in the Blue Book. There doesn't seem to be anything in the Red Book to suggest one should behave like this, but see remarks below on the relevance of the Black Book. (Gosh, I've mentioned all four of them!) On the first LaserWriter I tried I find that NewCenturySchlbk-Bold has UID 504 and NewCenturySchlbk-BoldItalic has UID 471, but it will depend on what versions of what fonts you have. I did find Palatino-Italic with UID 491 and Palatino-BoldItalic with UID 492, so differences of 1 certainly can occur. (BTW, AFM files from the Adobe fileserver seem to indicate that modern versions of the fonts have much larger UIDs, in the 28000+ range.) >What happens if I generate a UniqueID that isn't unique? As far as I can see, >the only way to guarantee uniqueness is to maintain a list of all the IDs in >use. Obviously this can be done but it seems like a lot of trouble. The Red >Book says that UniqueID is not necessarily present in all fonts. Would I be >better off to leave UniqueID out of my fonts if I'm not willing to guarantee >uniqueness? If you don't keep UniqueID's unique, you will be liable to pick up the wrong things from the font cache. UniqueID is never required, and if in any doubt it is better to undefine it. In this case the font cache entries will not survive the font disappearing from FontDirectory (e.g. at end of job), or at any rate they will never be used again and will be flushed out eventually. However: there would appear to be a difference here between type 3 fonts and type 1 fonts. For the former, there is just the one copy of UniqueID in the primary font directory; but for the latter there is also a copy in the "Private" directory. According to the Black Book (page 17) "if the UniqueID values are not present in both the font directory and Private directories, or if they have different values, then the font program is treated by the interpreter as if it had no UniqueID at all". Now if you are making a type 1 font by modifying one of the Adobe fonts in the style of the Green/Blue Book recipies, then you won't be able to modify the copy in the Private directory if you wanted to (as it is "noaccess"ed). So this would seem to mean that the prescription given is as good as unsetting UniqueID, in this case: it just isn't suitable for applying to a type 3 font. Anyexpert from Adobe care to comment? Chris Thompson JANET: cet1@uk.ac.cam.phx Internet: cet1%phx.cam.ac.uk@nsfnet-relay.ac.uk