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.

66 lines
1.7 KiB

1 month ago
  1. %!
  2. % grayscaled text test, including a trivial user bitmap font
  3. /grayalphsave save def % prevent left over effects
  4. /inch {72 mul} def
  5. /BuildCharDict 10 dict def
  6. /$ExampleFont 7 dict def
  7. $ExampleFont begin
  8. /FontType 3 def % user defined font.
  9. /FontMatrix [1 0 0 1 0 0] def
  10. /FontBBox [0 0 1 1] def
  11. /Encoding 256 array def
  12. 0 1 255 {Encoding exch /.notdef put} for
  13. Encoding (a) 0 get /plus put
  14. /CharStrings 2 dict def
  15. CharStrings /.notdef {} put
  16. CharStrings /plus
  17. { gsave
  18. 0 0 moveto
  19. 32 32 true [32 0 0 -32 0 32]
  20. {<0007E000 0007E000 0007E000 0007E000 0007E000 0007E000 0007E000 0007E000
  21. 0007E000 0007E000 0007E000 0007E000 0007E000 FFFFFFFF FFFFFFFF FFFFFFFF
  22. FFFFFFFF FFFFFFFF FFFFFFFF 0007E000 0007E000 0007E000 0007E000 0007E000
  23. 0007E000 0007E000 0007E000 0007E000 0007E000 0007E000 0007E000 0007E000>
  24. } imagemask
  25. grestore
  26. } put
  27. /BuildChar
  28. { BuildCharDict begin
  29. /char exch def
  30. /fontdict exch def
  31. /charproc
  32. fontdict /Encoding get char get
  33. fontdict /CharStrings get
  34. exch get def
  35. 1 0 0 0 1 1 setcachedevice
  36. charproc
  37. end
  38. } def
  39. end
  40. /MyFont $ExampleFont definefont pop
  41. newpath
  42. .5 inch 7.5 inch moveto
  43. 7.5 inch 0 rlineto
  44. 0 1.5 inch rlineto
  45. -7.5 inch 0 rlineto
  46. closepath
  47. 0 setgray
  48. fill
  49. /MyFont findfont 72 scalefont setfont
  50. .75 inch 7.75 inch moveto
  51. 0 1 6
  52. { /n exch def
  53. 1 n 6 div sub setgray
  54. (a) show
  55. } for
  56. clear cleardictstack
  57. grayalphsave restore
  58. % Per page independence description in the PLRM Section 3.7.3, showpage follows restore
  59. showpage