chiark / gitweb /
Parameterize sample.ps by the font size
authorBen Harris <bjh21@bjh21.me.uk>
Sun, 22 Mar 2020 10:15:03 +0000 (10:15 +0000)
committerBen Harris <bjh21@bjh21.me.uk>
Sun, 22 Mar 2020 10:15:03 +0000 (10:15 +0000)
I want to change the font size and I don't want to change a lot of
numbers.

sample.ps

index 060833918c149c61b295109b29ad5ed533a7054d..05dfbc2f893612092ef2a78a34021ca7a7d67eba 100644 (file)
--- a/sample.ps
+++ b/sample.ps
@@ -1,14 +1,15 @@
-<< /HWResolution [ 72 72 ] /PageSize [ 772 404 ] >> setpagedevice
-/Bedstead findfont 40 scalefont setfont
+/bpx { 4 mul } bind def
+<< /HWResolution [ 72 72 ] /PageSize [ 193 bpx 101 bpx ] >> setpagedevice
+/Bedstead findfont 10 bpx scalefont setfont
 /row { %def
     0 0 moveto
-    dup length 32 exch sub 12 mul 0 rmoveto
+    dup length 32 exch sub 3 bpx mul 0 rmoveto
     { %forall
        glyphshow
     } forall
-    0 -40 translate
+    0 -10 bpx translate
 } def
-0 373 translate
+0 93.25 bpx translate
 [ /A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z ] row
 [ /a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z ] row
 [ /a.sc/b.sc/c.sc/d.sc/e.sc/f.sc/g.sc/h.sc/i.sc/j.sc/k.sc/l.sc/m.sc