[comp.lang.postscript] What can you do to font dictionaries?

amanda@mermaid.intercon.com (Amanda Walker) (01/23/90)

In the red book under the definition of "scalefont", it says that the
operator makes a copy of the specified font dictionary with a new FontMatrix
entry.  What I am wondering is whether it's legal to write functions that
do similar things with other entries in the font dictionary.  In particular,
writing an "encodefont" procedure that makes a copy of a font dictionary
with a new encoding vector (but *not* registering it under a new name with
definefont) seems to work just fine under every version of Adobe PostScript
that I've tried.  Since the font cache works on FID/character name pairs,
it doesn't strike me that doing this would confuse the font cache.

My particular application in this case is to create a Type 3 font which
uses re-encoded versions of a couple existing fonts, but which don't ever
get referred to explicitly anywhere else.

Does anyone know of any problems with this or prohibitions against it in Adobe
technotes?

Amanda Walker
InterCon Systems Corporation
--

moore@RIGEL.FAC.CS.CMU.EDU (Dale Moore) (01/23/90)

Amanda Walker (from the Amanda and Woody show) says

	...
	Since the font cache works on FID/character name pairs,
	it doesn't strike me that doing this would confuse the font cache.
	...

That was also my first impression of how the font cache worked.
But consider the following tidbit of PostScript...

	/Times-Roman findfont 10 scalefont setfont
	100 100 moveto
	(first line printed) show
	100  80 moveto
	2 2 scale
	(second line printed) show

Both the first line printed and second line printed are printed in the
same font.  That is the font used in both lines has the same FID.
But the bitmaps of the characters used in those two lines are very
different.  The bitmaps of the characters used in the second line will
be twice as high and twice as wide as those in the first line.

So even though the characters are the same, and the FID is the same,
the resulting bitmap depends also upon the current transformation matrix.
I suspect that any font cache mechanism would also figure in somehow a
mechanism to deal with the current transformation matrix.

Dale Moore

amanda@mermaid.intercon.com (Amanda Walker) (01/24/90)

In article <7679@pt.cs.cmu.edu>, moore@RIGEL.FAC.CS.CMU.EDU (Dale Moore)
writes:
> So even though the characters are the same, and the FID is the same,
> the resulting bitmap depends also upon the current transformation matrix.
> I suspect that any font cache mechanism would also figure in somehow a
> mechanism to deal with the current transformation matrix.

Quite true--I'd forgotten to mention that.  Sorry...

Amanda Walker
InterCon Systems Corporation
--