[comp.lang.postscript] Some tricky questions

mkb@rover.ri.cmu.edu (Mike Blackwell) (07/27/88)

I've been doing some postscript hacking lately, and I've run in to a couple
of oddities that I haven't been able to figure out. I'm hoping someone else
has some ideas. First some background: I'm typesetting a book on
linguistics, and need some characters that aren't available in standard font
sets. Particularly, I need a velar-n and palatal-n. The velar-n is a normal
lower case n, but with a hook similar to the descender of a 'j' on the
second leg. A palatal-n is similar, but with the hook on the first leg.

No problem, I say - I'll just take an 'n' and a 'j,' and stick them together
with the appropriate clipping and glue.

The short PS program at the end of this message is an example of what I'm
doing, and illustrates the problems I've been having.

The main problem (I think) is that Adobe fonts are trickey. When you specify
small fonts sizes, there are 'hints' on how to best render them - one dot
can make a big difference at 300 dpi. Thus, if you print this example,
you'll see that the 500pt velar-n looks great, but the 10pt one is pretty
ragged around the start of the descender. A few more dots in there would
really improve how it looks. I haven't had a chance to print this at higher
resolution on our Linotype - hopefully it will look better.

The next strange thing: look at the horizontal line. Where the serifs were
cropped from the 'n,' the line is broken and slightly lower than it should
be. Odd...

The final problem, which may be simple: The velar_n and palatal_n routines
are set up for Times-Roman at 10pt. I figured I'd put the line "/Times-Roman
findfont 10 scalefont setfont" in each routine, right inside the gsave. When
I do that, though, I get a PostScript error "Undefined command. Offending
command: FID." When the font is set one level up (or two, as in the
example), everything works fine. How come? Where did that error come from?

If you can enlighten me on any of this, I'd appreciate it!

		Mike Blackwell		(mkb@rover.ri.cmu.edu)
		412-268-8830

(Oh yeah - I've been printing on an Apple Laserwriter, PS 38.0 rev 2)
--------------------
%!
/palatal_n {
  gsave
  0 0 moveto (n) show
  1 setgray
  0.08 0 moveto 0 .8 rlineto 0.64 0 rlineto 0 -.8 rlineto fill
  1.58 0 moveto 0 .8 rlineto 0.64 0 rlineto 0 -.8 rlineto fill
  346 0 moveto 
  grestore
  gsave
  -.49 0 translate
  -.60 0 moveto 0 -2.20 rlineto 2.70 0 rlineto 0 2.20 rlineto clip
  0 0 moveto (j) show
  grestore
} def

/velar_n {
  gsave
  0 0 moveto (n) show
  1 setgray
  2.775 0 moveto 0 .8 rlineto 0.64 0 rlineto 0 -.8 rlineto fill
  4.28 0 moveto 0 .8 rlineto 0.64 0 rlineto 0 -.8 rlineto fill
  346 0 moveto 
  grestore
  gsave
  2.21 0 translate
  -.60 0 moveto 0 -2.20 rlineto 2.70 0 rlineto 0 2.20 rlineto clip
  0 0 moveto (j) show
  grestore
} def

0 setlinewidth
100 0 moveto 100 792 lineto
0 200 moveto 612 200 lineto
stroke

/Times-Roman findfont 10 scalefont setfont

gsave
  100 200 translate
  50 50 scale
  velar_n
grestore

gsave
  400 600 translate
  velar_n
  10 0 moveto (n j) show
grestore

showpage