[comp.lang.postscript] Composite fonts

is@ukc.ac.uk (I.Salmon) (10/09/90)

I would like to create a composite font in which a few of the
characters in the Time-Roman font are replaced with characters from the
Symbol font.  I have studied the examples of font encoding in the blue
book and those in Real World Postscript but have so far failed to get
anything to work.

As a relative postscript novice I would appreciate any assistance you
could give me (and especially a concrete example I could follow).

Many thanks
Ian

mandler@apollo.HP.COM (John Mandler) (10/19/90)

I am trying to create a composite font that contains characters I define
plus outlines from a built in font. I have no trouble creating the composite
font. But when I try to insert an character path from a built in font, no
visible marks are made on the page for that character

From the red PostScript book, the font chapter (5) defines the entries in 
a built-in font . One of the elements is CharStrings. My understanding is that 
the following code should place the character's shape desription on the stack where 
I should be able to stroke it :

FontDirectory begin /Courier findfont 10000 scalefont  begin CharStrings /b get end end  100 100 moveto stroke
             
I expect to get a 10 point lower case b at position 100,100 . 

Any ideas ?
Thanks
----------------------------------------------------------------
        John Mandler    mandler@apollo.hp.com
        HP/Apollo       GTD East
        508-256-6600
----------------------------------------------------------------

rcd@ico.isc.com (Dick Dunn) (10/20/90)

mandler@apollo.HP.COM (John Mandler) writes:
> I am trying to create a composite font that contains characters I define
> plus outlines from a built in font...

This is inherently Very Difficult (I won't say "impossible" because Woody
probably has a back-door way to it:-) since the outlines in a built-in font
are stored in a protected, encoded form.

However, we can make some progress on the code presented...

> FontDirectory begin /Courier findfont ...

The "FontDirectory begin" is unnecessary; "findfont" searches FontDirectory
(by default).

>... 10000 scalefont ...

This scales to 10000 points (relative to user space), not 10.  Scalefont
works in terms of page coordinates--the internal 1000-units-to-the-em
factor is compensated out.

>... begin CharStrings /b get end end  100 100 moveto stroke
>              
> I expect to get a 10 point lower case b at position 100,100 . 

After the "/b get" you've picked up the value of the CharStrings entry for
the character b, but you haven't done anything with it.  You've got
something on the stack representing a procedure for producing the outline
for the character; however, at this point the problems are:
	- it's only on the stack; it's not in the path yet, so there's
	  nothing to stroke
	- it's not clear how to get it into the path, since the object
	  is in some unspecified (the red book says "proprietary") format
-- 
Dick Dunn     rcd@ico.isc.com -or- ico!rcd       Boulder, CO   (303)449-2870
   ...Never offend with style when you can offend with substance.