aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/llgcode/ps/samples/grayalph.ps
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/llgcode/ps/samples/grayalph.ps')
-rw-r--r--vendor/github.com/llgcode/ps/samples/grayalph.ps65
1 files changed, 65 insertions, 0 deletions
diff --git a/vendor/github.com/llgcode/ps/samples/grayalph.ps b/vendor/github.com/llgcode/ps/samples/grayalph.ps
new file mode 100644
index 0000000..2a83474
--- /dev/null
+++ b/vendor/github.com/llgcode/ps/samples/grayalph.ps
@@ -0,0 +1,65 @@
+%!
+% grayscaled text test, including a trivial user bitmap font
+
+/grayalphsave save def % prevent left over effects
+
+/inch {72 mul} def
+
+/BuildCharDict 10 dict def
+/$ExampleFont 7 dict def
+$ExampleFont begin
+ /FontType 3 def % user defined font.
+ /FontMatrix [1 0 0 1 0 0] def
+ /FontBBox [0 0 1 1] def
+ /Encoding 256 array def
+ 0 1 255 {Encoding exch /.notdef put} for
+ Encoding (a) 0 get /plus put
+ /CharStrings 2 dict def
+ CharStrings /.notdef {} put
+ CharStrings /plus
+ { gsave
+ 0 0 moveto
+ 32 32 true [32 0 0 -32 0 32]
+ {<0007E000 0007E000 0007E000 0007E000 0007E000 0007E000 0007E000 0007E000
+ 0007E000 0007E000 0007E000 0007E000 0007E000 FFFFFFFF FFFFFFFF FFFFFFFF
+ FFFFFFFF FFFFFFFF FFFFFFFF 0007E000 0007E000 0007E000 0007E000 0007E000
+ 0007E000 0007E000 0007E000 0007E000 0007E000 0007E000 0007E000 0007E000>
+ } imagemask
+ grestore
+ } put
+ /BuildChar
+ { BuildCharDict begin
+ /char exch def
+ /fontdict exch def
+ /charproc
+ fontdict /Encoding get char get
+ fontdict /CharStrings get
+ exch get def
+ 1 0 0 0 1 1 setcachedevice
+ charproc
+ end
+ } def
+end
+
+/MyFont $ExampleFont definefont pop
+
+ newpath
+ .5 inch 7.5 inch moveto
+ 7.5 inch 0 rlineto
+ 0 1.5 inch rlineto
+ -7.5 inch 0 rlineto
+ closepath
+ 0 setgray
+ fill
+
+ /MyFont findfont 72 scalefont setfont
+ .75 inch 7.75 inch moveto
+ 0 1 6
+ { /n exch def
+ 1 n 6 div sub setgray
+ (a) show
+ } for
+
+showpage
+clear cleardictstack
+grayalphsave restore