home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / alt / sources / 2533 / fontlist.ps next >
Encoding:
Text File  |  1992-11-16  |  1.2 KB  |  68 lines

  1. %!
  2.  
  3. % PostScript font lister
  4. % by Charles Hannum, 16 November 1992
  5.  
  6. % Prints a sample of each of the fonts in a printer's FontDirectory.
  7.  
  8. /start usertime def
  9.  
  10. .so mergesort.ps
  11.  
  12. /height 12 def
  13. /baselineskip height 1.5 mul def
  14.  
  15. /header-height 12 def
  16. /header-font /Times-Bold findfont header-height scalefont def
  17. /topskip header-height def
  18.  
  19. /top-margin 720 def
  20. /bottom-margin 72 def
  21. /left-margin 72 def
  22. /right-margin 540 def
  23.  
  24. /buffer 100 string def
  25.  
  26. /startpage {
  27.   /y top-margin header-height sub def
  28.   left-margin y moveto
  29.   header-font setfont
  30.   (PostScript font samples at ) show
  31.   height buffer cvs show
  32.   ( pt.) show
  33.   /y y topskip sub def
  34. } def
  35.  
  36. /fontsample {
  37.   /y y baselineskip sub def
  38.   y bottom-margin lt {
  39.     showpage
  40.     startpage
  41.     fontsample
  42.   } {
  43.     left-margin y moveto
  44.     height scalefont setfont
  45.     buffer cvs show
  46.     (ABCDWXYZ abcdwxyz 0123456789) dup
  47.     stringwidth pop right-margin exch sub y moveto show
  48.   }
  49.   ifelse
  50. } def
  51.  
  52. startpage
  53.  
  54. 2 dict begin
  55.   /a 40 string def
  56.   /b 40 string def
  57.   {0 get a cvs exch
  58.    0 get b cvs exch
  59.    lt} FontDirectory mergesort
  60. end
  61. {aload pop fontsample} forall
  62.  
  63. showpage
  64.  
  65. usertime start sub 1000 div
  66. buffer cvs print
  67. ( seconds.\n) print
  68.