You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
1.9 KiB

1 month ago
  1. %!
  2. % Check for command line parameters:
  3. % Name, FirstSize, Ratio, NumSizes, UseOutline.
  4. /alphabetsave save def % prevent left over effects
  5. /FontName where { pop } { /FontName (Palatino-Italic) def } ifelse
  6. /FirstSize where { pop } { /FirstSize 15 def } ifelse
  7. /CurrentSize FirstSize def
  8. /Ratio where { pop } { /Ratio 1.6 def } ifelse
  9. /NumSizes where { pop } { /NumSizes 3 def } ifelse
  10. /UseOutline where { pop } { /UseOutline false def } ifelse
  11. /Strings FirstSize 20 gt
  12. { [
  13. (ABCDEFGHIJ) (KLMNOPQR) (STUVWXYZ)
  14. (abcdefghijklm) (nopqrstuvwxyz)
  15. (0123456789<=>) (:;?@ !"#$%&')
  16. (\(\)*+,-./[\\]^_) (`{|}~)
  17. ] }
  18. { [
  19. (ABCDEFGHIJKLMNOPQRSTUVWXYZ)
  20. (abcdefghijklmnopqrstuvwxyz)
  21. (0123456789<=>:;?@ !"#$%&')
  22. (\(\)*+,-./ [\\]^_ `{|}~)
  23. ] }
  24. ifelse def
  25. /sshow
  26. { gsave UseOutline
  27. { { gsave ( ) dup 0 4 -1 roll put
  28. false charpath pathbbox 0 setlinewidth stroke grestore
  29. pop 8 add currentpoint exch pop moveto pop
  30. } forall
  31. }
  32. { 2 0 3 -1 roll ashow }
  33. ifelse grestore
  34. } def
  35. FontName findfont FirstSize scalefont setfont
  36. clippath pathbbox /top exch def pop pop pop newpath
  37. 10 10 moveto
  38. NumSizes
  39. {
  40. gsave
  41. CurrentSize 50 lt {
  42. FontName findfont 50 scalefont setfont
  43. (Q) false charpath pathbbox
  44. exch pop exch sub exch pop 1.25 mul CurrentSize 50 div mul /height exch def
  45. }{
  46. (Q) false charpath pathbbox
  47. exch pop exch sub exch pop 1.25 mul /height exch def
  48. } ifelse
  49. grestore
  50. Strings
  51. { currentpoint exch pop top height 3 mul sub gt
  52. { showpage 10 10 height sub moveto
  53. }
  54. if
  55. dup sshow
  56. UseOutline not
  57. { 0 height rmoveto gsave 0.01 rotate sshow grestore }
  58. if
  59. 0 height rmoveto
  60. } forall
  61. /CurrentSize FirstSize Ratio mul def
  62. FontName findfont CurrentSize scalefont setfont
  63. /Ratio Ratio dup mul def
  64. } repeat
  65. clear cleardictstack
  66. alphabetsave restore
  67. % Per page independence description in the PLRM Section 3.7.3, showpage follows restore
  68. showpage