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.

175 lines
9.2 KiB

1 month ago
  1. %%
  2. %% Idioms for the Windows PSCRIPT5 PostScript driver
  3. %%
  4. currentuserparams /IdiomRecognition get
  5. <</IdiomRecognition false>> setuserparams
  6. /Pscript5Idiom
  7. <<
  8. %% replacements for the artificial bold routines. When the current device supports text rendering modes we set the mode to 2 (fill and stroke)
  9. %% and only show the text once, which improves seaching with pdfwrite. The parameter 'sBdx' is always calculated as the intended print resolution/300.
  10. %% We can't do that in PDF so we just use a heuristically derived fixed value.
  11. /xsB [
  12. {2 copy 2 copy 2 copy gsave sBdx 0 rmoveto xshow grestore gsave 0 sBdx rmoveto xshow grestore gsave sBdx sBdx rmoveto xshow grestore xshow} bind
  13. {
  14. /PreserveTrMode /GetDeviceParam .special_op {
  15. exch pop
  16. }{
  17. //false
  18. }ifelse
  19. { gsave sBdx 2 div dup 0.2 setlinewidth currentcolor currentcolorspace .swapcolors setcolorspace setcolor .swapcolors rmoveto 2 .settextrenderingmode xshow currentpoint grestore moveto}
  20. {2 copy 2 copy 2 copy gsave sBdx 0 rmoveto xshow grestore gsave 0 sBdx rmoveto xshow grestore gsave sBdx dup rmoveto xshow grestore xshow} bind
  21. ifelse
  22. } bind
  23. ]
  24. /ysB [
  25. {2 copy 2 copy 2 copy gsave sBdx 0 rmoveto yshow grestore gsave 0 sBdx rmoveto yshow grestore gsave sBdx sBdx rmoveto yshow grestore yshow} bind
  26. {
  27. /PreserveTrMode /GetDeviceParam .special_op {
  28. exch pop
  29. }{
  30. //false
  31. }ifelse
  32. { gsave sBdx 2 div dup 0.2 setlinewidth currentcolor currentcolorspace .swapcolors setcolorspace setcolor .swapcolors rmoveto 2 .settextrenderingmode yshow currentpoint grestore moveto}
  33. {2 copy 2 copy 2 copy gsave sBdx 0 rmoveto yshow grestore gsave 0 sBdx rmoveto yshow grestore gsave sBdx dup rmoveto yshow grestore yshow} bind
  34. ifelse
  35. } bind
  36. ]
  37. /zsB [
  38. {2 copy 2 copy 2 copy gsave sBdx 0 rmoveto xyshow grestore gsave 0 sBdx rmoveto xyshow grestore gsave sBdx sBdx rmoveto xyshow grestore xyshow} bind
  39. {
  40. /PreserveTrMode /GetDeviceParam .special_op {
  41. exch pop
  42. }{
  43. //false
  44. }ifelse
  45. { gsave sBdx 2 div dup 0.2 setlinewidth currentcolor currentcolorspace .swapcolors setcolorspace setcolor .swapcolors rmoveto 2 .settextrenderingmode xyshow currentpoint grestore moveto}
  46. {2 copy 2 copy 2 copy gsave sBdx 0 rmoveto xyshow grestore gsave 0 sBdx rmoveto xyshow grestore gsave sBdx dup rmoveto xyshow grestore xyshow} bind
  47. ifelse
  48. } bind
  49. ]
  50. /sB [
  51. {1 copy 2 copy gsave sBdx 0 rmoveto show grestore gsave 0 sBdx rmoveto show grestore gsave sBdx sBdx rmoveto show grestore show} bind
  52. {
  53. /PreserveTrMode /GetDeviceParam .special_op {
  54. exch pop
  55. }{
  56. //false
  57. }ifelse
  58. { gsave sBdx 2 div dup 0.2 setlinewidth currentcolor currentcolorspace .swapcolors setcolorspace setcolor .swapcolors rmoveto 2 .settextrenderingmode show currentpoint grestore moveto}
  59. {1 copy 2 copy gsave sBdx 0 rmoveto show grestore gsave 0 sBdx rmoveto show grestore gsave sBdx dup rmoveto show grestore show} bind
  60. ifelse
  61. } bind
  62. ]
  63. /asB [
  64. {3 copy 3 copy 3 copy gsave sBdx 0 rmoveto ashow grestore gsave 0 sBdx rmoveto ashow grestore gsave sBdx sBdx rmoveto ashow grestore ashow} bind
  65. {
  66. /PreserveTrMode /GetDeviceParam .special_op {
  67. exch pop
  68. }{
  69. //false
  70. }ifelse
  71. { gsave sBdx 2 div dup 0.2 setlinewidth currentcolor currentcolorspace .swapcolors setcolorspace setcolor .swapcolors rmoveto 2 .settextrenderingmode ashow currentpoint grestore moveto}
  72. {3 copy 3 copy 3 copy gsave sBdx 0 rmoveto ashow grestore gsave 0 sBdx rmoveto ashow grestore gsave sBdx dup rmoveto ashow grestore ashow} bind
  73. ifelse
  74. } bind
  75. ]
  76. /wsB [
  77. {3 copy 3 copy 3 copy gsave sBdx 0 rmoveto widthshow grestore gsave 0 sBdx rmoveto widthshow grestore gsave sBdx sBdx rmoveto widthshow grestore widthshow} bind
  78. {
  79. /PreserveTrMode /GetDeviceParam .special_op {
  80. exch pop
  81. }{
  82. //false
  83. }ifelse
  84. { gsave sBdx 2 div dup 0.2 setlinewidth currentcolor currentcolorspace .swapcolors setcolorspace setcolor .swapcolors rmoveto 2 .settextrenderingmode widthshow currentpoint grestore moveto}
  85. {3 copy 3 copy 3 copy gsave sBdx 0 rmoveto widthshow grestore gsave 0 sBdx rmoveto widthshow grestore gsave sBdx dup rmoveto widthshow grestore widthshow} bind
  86. ifelse
  87. } bind
  88. ]
  89. /awsB [
  90. {3 copy 3 copy 3 copy gsave sBdx 0 rmoveto awidthshow grestore gsave 0 sBdx rmoveto awidthshow grestore gsave sBdx sBdx rmoveto awidthshow grestore awidthshow} bind
  91. {
  92. /PreserveTrMode /GetDeviceParam .special_op {
  93. exch pop
  94. }{
  95. //false
  96. }ifelse
  97. { gsave sBdx 2 div dup 0.2 setlinewidth currentcolor currentcolorspace .swapcolors setcolorspace setcolor .swapcolors rmoveto 2 .settextrenderingmode awidthshow currentpoint grestore moveto}
  98. {3 copy 3 copy 3 copy gsave sBdx 0 rmoveto awidthshow grestore gsave 0 sBdx rmoveto awidthshow grestore gsave sBdx dup rmoveto awidthshow grestore awidthshow} bind
  99. ifelse
  100. } bind
  101. ]
  102. /pbf [
  103. {
  104. gsave pop /fEOFill exch def GDIBWPatternDict begin /yOrg exch def /xOrg exch def /PaintData exch def/OutputBPP exch def
  105. /Height exch def/Width exch def/PaintType 1 def/PatternType 1 def/TilingType 1 def/BBox[0 0
  106. Width Height]def/XStep Width def/YStep Height def/mx xOrg yOrg matrix translate def 20 dict dup begin
  107. /ImageType 1 def/Width Width def/Height Height def/ImageMatrix[1 0 0 1 0 0]def
  108. /BitsPerComponent 8 def OutputBPP 24 eq{/Decode[0 1 0 1 0 1]def}{OutputBPP 8 eq{
  109. /Decode[0 1]def}{/Decode[0 1 0 1 0 1 0 1]def}ifelse}ifelse/DataSource{PaintData}def end/ImageDict
  110. exch def/PaintProc{begin ImageDict image end}b currentdict mx makepattern setpattern end fEOFill{eofill}{fill}
  111. ifelse grestore
  112. }bind
  113. {
  114. /IsDistiller /GetDeviceParam .special_op {
  115. exch pop
  116. }{
  117. //false
  118. } ifelse
  119. {gsave pop /fEOFill exch def GDIBWPatternDict begin /yOrg exch def /xOrg exch def /PaintData exch def/OutputBPP exch def
  120. /Height exch def/Width exch def/PaintType 1 def/PatternType 1 def/TilingType 1 def/BBox[0 0
  121. 1 1]def/XStep 1 def/YStep 1 def/mx xOrg yOrg matrix translateWidth Height 3 -1 roll scale def 20 dict dup begin
  122. /ImageType 1 def/Width Width def/Height Height def/ImageMatrix[1 0 0 1 0 0]def
  123. /BitsPerComponent 8 def OutputBPP 24 eq{/Decode[0 1 0 1 0 1]def}{OutputBPP 8 eq{
  124. /Decode[0 1]def}{/Decode[0 1 0 1 0 1 0 1]def}ifelse}ifelse/DataSource{PaintData}def end/ImageDict
  125. exch def/PaintProc{begin ImageDict image end}b currentdict mx makepattern setpattern end fEOFill{eofill}{fill}
  126. ifelse grestore
  127. }{
  128. gsave pop /fEOFill exch def GDIBWPatternDict begin /yOrg exch def /xOrg exch def /PaintData exch def/OutputBPP exch def
  129. /Height exch def/Width exch def/PaintType 1 def/PatternType 1 def/TilingType 1 def/BBox[0 0
  130. Width Height]def/XStep Width def/YStep Height def/mx xOrg yOrg matrix translate def 20 dict dup begin
  131. /ImageType 1 def/Width Width def/Height Height def/ImageMatrix[1 0 0 1 0 0]def
  132. /BitsPerComponent 8 def OutputBPP 24 eq{/Decode[0 1 0 1 0 1]def}{OutputBPP 8 eq{
  133. /Decode[0 1]def}{/Decode[0 1 0 1 0 1 0 1]def}ifelse}ifelse/DataSource{PaintData}def end/ImageDict
  134. exch def/PaintProc{begin ImageDict image end}b currentdict mx makepattern setpattern end fEOFill{eofill}{fill}
  135. ifelse grestore
  136. } ifelse
  137. }bind
  138. ]
  139. /mask_pbf [
  140. {gsave /fEOFill exch def 20 dict begin /yOrg exch def /xOrg exch def /PaintData exch def /Height exch def
  141. /Width exch def /PatternType 1 def /PaintType 2 def /TilingType 1 def /BBox[0 0 Width Height] def
  142. /XStep Width def /YStep Height def /mx xOrg yOrg matrix translate def /PaintProc{begin Width Height T 1 1 dtransform abs exch abs exch 0 0 3 -1 roll 0 0 6 array astore {PaintData}imagemask end} b
  143. currentdict mx makepattern setpattern end fEOFill{eofill}{fill}ifelse grestore} bind
  144. {
  145. /IsDistiller /GetDeviceParam .special_op {
  146. exch pop
  147. }{
  148. //false
  149. } ifelse
  150. {
  151. gsave
  152. /fEOFill exch def 20 dict begin /yOrg exch def /xOrg exch def /PaintData exch def
  153. /Height exch def /Width exch def /PatternType 1 def /PaintType 2 def /TilingType 1 def
  154. /BBox[0 0 1 1] def
  155. /XStep 1 def /YStep 1 def
  156. /mx xOrg yOrg matrix translate Width Height 3 -1 roll scale def
  157. /PaintProc{begin Width Height T Width Height 0 0 3 -1 roll 0 0 6 array astore {PaintData}imagemask end} b
  158. currentdict mx makepattern setpattern end fEOFill{eofill}{fill}ifelse grestore
  159. }{
  160. gsave /fEOFill exch def 20 dict begin /yOrg exch def /xOrg exch def /PaintData exch def /Height exch def
  161. /Width exch def /PatternType 1 def /PaintType 2 def /TilingType 1 def /BBox[0 0 Width Height] def
  162. /XStep Width def /YStep Height def /mx xOrg yOrg matrix translate def /PaintProc{begin Width Height T 1 1 dtransform abs exch abs exch 0 0 3 -1 roll 0 0 6 array astore {PaintData}imagemask end} b
  163. currentdict mx makepattern setpattern end fEOFill{eofill}{fill}ifelse grestore
  164. } ifelse
  165. } bind
  166. ]
  167. >>
  168. /IdiomSet defineresource pop
  169. <</IdiomRecognition 3 -1 roll>> setuserparams