chiark / gitweb /
max and minprintable
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 4 Mar 2019 01:25:27 +0000 (01:25 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 4 Mar 2019 01:25:27 +0000 (01:25 +0000)
.gitignore
Makefile
generate-board

index 7b6b82e2fc292ff35353627eb3cef8a707ece468..895aae54da04639ca0b14c0e8e10b292fd0f32e9 100644 (file)
@@ -5,7 +5,8 @@ opt.plag
 faces.plag
 .opt.plag.sums
 *.tmp
-whole.ps
+maxprintable.ps
+minprintable.ps
 layout-test.ps
 layout-test-?.ps
 a4-test-?.ps
index fef7280deb9bccf048ea95864197ca1ba41da0bf..d9e0cc9c917d9e2b54dc6716a3785cb0333dad46 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -17,7 +17,7 @@ USE_PLAG_RELEASE := $(shell ./find-plag \
 
 default: all
 
-all: whole.ps layout-test.ps \
+all: maxprintable.ps minprintable.ps layout-test.ps \
        $(addprefix a4-test-,$(addsuffix .ps, b m t)) \
        $(addprefix layout-test-,$(addsuffix .ps, b m t))
 
@@ -38,16 +38,19 @@ opt.plag: maybe-rerun-optim map.plag $(USE_PLAG_RELEASE) Makefile
 faces.plag: opt.plag $(USE_PLAG_DEBUG) Makefile
        $(USE_PLAG_DEBUG) RF $< W-FACES $@.tmp && $i
 
-whole.ps: generate-board faces.plag input-graph misc-data.pl Parse.pm
-       ./generate-board -XS faces.plag input-graph $o
+maxprintable.ps: generate-board faces.plag input-graph misc-data.pl Parse.pm
+       ./generate-board faces.plag input-graph $o
 
-layout-test.ps: whole.ps Makefile Parse.pm
+minprintable.ps: generate-board faces.plag input-graph misc-data.pl Parse.pm
+       ./generate-board -XM faces.plag input-graph $o
+
+layout-test.ps: maxprintable.ps Makefile Parse.pm
        ./generate-board -XW faces.plag input-graph $o
 
 layout-test-%.ps: layout-test-prefix-%.ps layout-test.ps
        cat $^ $o
 
-a4-test-%.ps: layout-test-prefix-%.ps whole.ps
+a4-test-%.ps: layout-test-prefix-%.ps maxprintable.ps
        cat $^ $o
 
 #map.ps: map.dot
index a6d00c51a0c6eb037f6ede6f0babe43786110e9b..b2f8e8110ee9e71bdf34010e6ebb4a0e28636dbd 100755 (executable)
@@ -16,7 +16,7 @@ BEGIN { unshift @INC, qw(.); }
 
 use Parse;
 
-our $xopts;
+our $xopts = '';
 our $facesf;
 our %vxname2pos; # $vxname2pos{VXNAME} = Math::GSL::Vector
 
@@ -25,6 +25,13 @@ sub MM2PT { 72.0 / 25.4; }
 
 our $mid;
 
+our $a4_w = 595;
+our $a4_h = 842;
+our $a3_h = 1190;
+
+our $max_printeredge = 5.50;
+
+
 # ----- region names from plag, incl. reverse mapping -----
 
 our %prs2region;
@@ -306,12 +313,12 @@ sub pscolour ($;$) {
 }
 
 sub preamble() {
-  my $printeredge = 5 * MM2PT;
-  my $xsz = 842;
-  my $ysz = 3 * 595 - 4 * $printeredge;
+  my $tprinteredge = ($xopts =~ m/M/ ? $max_printeredge : 0) * MM2PT;
+  my $xmax = $a4_h - $tprinteredge;
+  my $ymax = ($a4_w + $a3_h) - 2 * $max_printeredge - $tprinteredge;
   o(<<END);
 %!PS-Adobe-3.0
-%%BoundingBox 0 0 $xsz $ysz
+%%BoundingBox $tprinteredge $tprinteredge $xmax $ymax
 %%Pages: 1
 %%EndComments
 %%BeginProlog
@@ -321,9 +328,7 @@ sub preamble() {
   gsave
   40 -26 translate
 END
-  #o(" 0.52 dup scale\n") if $xopts =~ m/S/;
-  #o("%%Box 0 0 $xsz $ysz");
-  # xxx split into pages?
+  # xxx split into pages
 }
 
 sub postamble () {