home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / clipart / gs22.zip / PRFONT.PS < prev    next >
Text File  |  1991-05-16  |  2KB  |  84 lines

  1. %!PS-Adobe-1.0
  2. %%Creator: Eric Gisin <egisin@waterloo.csnet>
  3. %%Title: Print font catalog
  4. % Copyright (c) 1986 Eric Gisin
  5.  
  6. % Example usages at bottom of file
  7.  
  8. /#copies 1 def
  9.  
  10. /T6 /Times-Roman findfont 6 scalefont def
  11. /Temp 64 string def
  12. /Inch {72 mul} def
  13. /Base 16 def    % char code output base
  14.  
  15. % do single character of page
  16. % output to rectangle ll=(0,-24) ur=(36,24)
  17. /DoChar {
  18.   /C exch def
  19.   /S (_) dup 0 C put def
  20.   /N F /Encoding get C get def
  21.  
  22.   % print code name, width and char name
  23.   /W F setfont S stringwidth pop def
  24.   T6 setfont
  25.   N /.notdef ne {0 -20 moveto N Temp cvs show} if
  26.   0 -12 moveto C Base Temp cvrs show (  ) show
  27.   W 0.0005 add Temp cvs 0 5 getinterval show
  28.  
  29.   % print char with reference lines
  30.   N /.notdef ne {
  31.     3 0 translate
  32.     0 0 moveto F24 setfont S show
  33.     /W S stringwidth pop def
  34.     0 -6 moveto 0 24 lineto
  35.     W -6 moveto W 24 lineto
  36.     -3 0 moveto W 3 add 0 lineto
  37.     0 setlinewidth stroke
  38.   } if
  39. } def
  40.  
  41. % print font sample page
  42. /DoFont {
  43.   /FName exch def    % font name
  44.   /F FName findfont def
  45.   /F24 F 24 scalefont def
  46.   /Line0 96 string def
  47.   /Line1 96 string def
  48.  
  49.   /Times-Roman findfont 18 scalefont setfont
  50.   18 10.5 Inch moveto FName Temp cvs show ( ) show ((24 point)) show
  51.  
  52.   0 1 95 {
  53.     /I exch def
  54.     /Xn I 16 mod def /Yn I 16 idiv def
  55.  
  56.     % chars 20-7F
  57.     gsave
  58.     Xn 36 mul 18 add Yn -48 mul 9.5 Inch add translate
  59.     Line0 I I 16#20 add put
  60.     I 16#20 add DoChar
  61.     grestore
  62.  
  63.     % chars A0-FF
  64.     gsave
  65.     Xn 36 mul 18 add Yn -48 mul 4.5 Inch add translate
  66.     Line1 I I 16#A0 add put
  67.     I 16#A0 add DoChar
  68.     grestore
  69.   } for
  70.  
  71.   F 10 scalefont setfont
  72.   18 5.5 Inch moveto Line0 show
  73.   18 0.5 Inch moveto Line1 show
  74.  
  75.   showpage
  76. } def
  77.  
  78. % Do font samples
  79. % /Times-Roman DoFont            % Test (less than a minute)
  80. % /Hershey-Gothic-English DoFont    % Test (8 minutes)
  81.  
  82. % Do a complete catalog
  83. % FontDirectory {pop DoFont} forall    % All fonts (quite a long time)
  84.