home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume20 / psroff / part01 / upload.sh < prev    next >
Encoding:
Text File  |  1989-10-17  |  1.3 KB  |  77 lines

  1. :
  2. #@(#)upload 1.1 89/05/18
  3. rlp -dgate!AppleLaser << 'END'
  4.  
  5. /savearea save def
  6.  
  7. /tmp 1 string def
  8.  
  9. /myscale {
  10.     2 mul round cvi
  11. } def
  12.  
  13. /dumpwidths {
  14.  
  15.     dup
  16.     (                                               ) cvs print 
  17.     (\n) print
  18.     findfont 18 scalefont setfont
  19.     0 1 255 
  20.     { 
  21.     newpath
  22.     /i exch def
  23.     0 0 moveto
  24.     tmp 0 i put
  25.  
  26.     tmp stringwidth pop /width exch def 
  27.  
  28.     %    Set current point again.
  29.     0 0 moveto
  30.     /curx currentpoint pop def
  31.  
  32.     % retrieve bounding box info.
  33.     tmp false charpath flattenpath pathbbox
  34.     /ury exch def
  35.     /urx exch def
  36.     /lly exch def
  37.     /llx exch def
  38.  
  39.     % calc left bearing as leftx - curx
  40.  
  41.     /lbear llx curx sub myscale def
  42.  
  43.     % calc height as upper y - lower y
  44.  
  45.     /heights ury lly sub myscale def
  46.  
  47.     % calc right bearing as width - upper x
  48.  
  49.     /rbear width urx curx sub sub myscale def
  50.  
  51.     i (    ) cvs print (,) print
  52.     lbear (    ) cvs print (,) print
  53.     width myscale (    ) cvs print (,) print
  54.     rbear (    ) cvs print (,) print
  55.     heights (    ) cvs print (\n) print
  56.  
  57.  
  58.     } 
  59.     for 
  60. } def
  61.  
  62. FontDirectory {
  63.     pop
  64.     (                                                  ) cvs print
  65.     (\n) print
  66. } forall
  67.  
  68. FontDirectory {
  69.     pop
  70.     dup (                                              ) cvs (cmr10-300) ne {
  71.     dumpwidths
  72.     } if
  73. } forall
  74.  
  75. savearea restore
  76. END
  77.