CompuServe Thread

#ReEncode bug

3 messages in this thread
#6621From: Lenox H. BrassellNov 8, 1988 4:04 PM
I am using the ReEncode procedure which I found in the file PS-17C.TXT in DL4. For reasons I don't understand, the new font which I make will not work if the new Encoding vector is too different from the original one. Consider the following re-encoding fonts: /VeryDifferent [256 {/.notdef} repeat] def VeryDifferent 32 /Aacute put /Courier /Courier-D VeryDifferent ReEncode /VerySimilar 256 array def StandardEncoding VerySimilar copy VerySimilar 32 /Aacute put /Courier /Courier-S VerySimilar ReEncode The Courier-D font will cause an "invalidfont" error when I try to show the "Aacute" character, but the Courier-S font will do what is desired. That is, /Courier-S findfont 12 scalefont setfont 72 720 moveto ( ) show % This works. /Courier-D findfont 13 scalefont setfont % Force a Cache Miss 72 720 moveto ( ) show % This fails. Can anyone tell me why the /Courier-D font fails? –Lenox
#6628From: Steve WernerNov 8, 1988 6:35 PM
If I understand what you're doing with the re-encoded /Courier-D font, you're put /.notdef in all 256 positions of the array, then replacing one position with a composite character. It appears that you're also removing the components of the composite character. From the Tutorial and Cookbook, p. 200 (Blue Book): "When encoding accented characters it is important to understand that accented characters (also known as composite characters) are actually a composite of the letter and the accent. In order to print accented characters properly, both the letter and the accent of the composite character must be encoded in the encoding vector, as well as the composite character itself. For example, if you wish to encode the composite character 'Aacute,' both the 'A' and the 'acute' must be encoded."
#6641From: Lenox H. BrassellNov 9, 1988 11:45 AM
Steve, Looks like you're exactly right — that's what the book says. But I don't really understand the need for the components of composite characters to be in the encoding vector. I'd think that the fact that /A and /acute are defined in CharStrings would be enough information for the character to image itself. I guess Adobe chose an implementation for their fonts which makes them a little less flexible than they could be.