chiark / gitweb /
wip labels
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 4 Mar 2019 17:13:09 +0000 (17:13 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 4 Mar 2019 17:13:09 +0000 (17:13 +0000)
cmyk.ps

diff --git a/cmyk.ps b/cmyk.ps
index 70857fe18a1c3c0882ecd4f10cc3084f65556629..d359052d521e4ecda63535d54225978c2d4cc1d7 100644 (file)
--- a/cmyk.ps
+++ b/cmyk.ps
@@ -12,7 +12,7 @@
 /printareax paperx margin 2 mul sub def
 /printareay papery margin 2 mul sub def
 
-/textx 12 def
+/textx 20 def
 /texty 12 def
 
 /szox printareax textx sub def
 
 % strid = stride
 
+/klist_get {
+    klist
+        blackx
+        blacky  knx mul add
+       get
+} def
+/kentry_moveto {
+                blackx                         stridix mul
+                 blacky  neg kmy add           stridiy mul
+                 szfy -0.5 mul add
+} def
+
 /someyellow {
     
     /gn     gm    1 add   def
                  magenta       gn div
                  yellow                gn div
 
-               klist
-                 blackx
-                 blacky  knx mul add
-                get base div
+               klist_get base div
 
                  setcmykcolor
 
-                blackx                         stridix mul
-                 blacky  neg kmy add           stridiy mul
-                 szfy -0.5 mul add
-                 moveto
+               kentry_moveto moveto
 
                 szfx 0 rlineto stroke
 
     (Y) show
     yellow (___) cvs show
 
-        showpage
+    finish_page
+
     } for
 
 } def
 
+/finish_page {
+    0 setgray
+    /Helvetica findfont texty scalefont setfont
+    gsave
+
+     margin
+     papery  margin sub texty 2 mul sub  stridoy sub
+      translate
+      
+      0 1 kmx {        /blackx exch def
+      0 1 kmy {        /blacky exch def
+        kentry_moveto exch 0.75 mul exch moveto
+        klist_get (__) cvs
+        show
+      } for
+      } for
+    grestore
+
+    showpage
+} def
+
 /base 16 def
 
 /gm 16 def
@@ -153,7 +181,7 @@ grestore
 
 } for
 } for
-showpage
+finish_page
 } for
 
 } def