chiark / gitweb /
wip words
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 3 Mar 2019 01:42:19 +0000 (01:42 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 3 Mar 2019 01:42:19 +0000 (01:42 +0000)
generate-board

index 0bf4bf6ac451cf62dbccadfd80d661da772c3d44..3af70c38844470a83fa263e2097dece1efdbb5e7 100755 (executable)
@@ -439,7 +439,7 @@ sub label_faces() {
   my $sz = 18;
   my $shadow = $sz * 0.1;
   o(<<END);
-  /wordshow {
+  /wordsshow {
     0 setgray 0 10 359 {
       dup  cos $shadow mul
       exch sin $shadow mul
@@ -498,7 +498,7 @@ END
     }
     o(<<END);
   } bind def
-  wordshow
+  wordsshow
 END
   }
 }
@@ -660,8 +660,8 @@ sub dykes(){
   }
 }
 
-sub hs_initial_1 ($$$;$) {
-  my ($colour, $xi,$yi, $fn) = @_;
+sub hs_initial_1 ($$$;$$) {
+  my ($colour, $xi,$yi, $text, $fn) = @_;
   my $interval = $hs_sz * 1.75;
   my $demo_h = $hs_sz; #water_cubes_sz(3);
   my $demo_x0 = $hs_sz * 0.75 + $dyke_l * 0.60;
@@ -677,6 +677,8 @@ sub hs_initial_1 ($$$;$) {
   }
   one_hs($colour, mkvec(0,0));
   if ($fn) {
+    o("    /words { 2 copy moveto ($text) show } bind def");
+    o("    gsave 0 0 moveto wordsshow grestore\n");
     o("    $demo_x0 ",($hs_sz * -0.25)," translate\n");
     $fn->();
   }
@@ -686,11 +688,11 @@ sub hs_initial_1 ($$$;$) {
 sub hs_initial () {
   hs_initial_1('red',     0,0);
   hs_initial_1('purple',  0,1);
-  hs_initial_1('green',   1,0, sub {
+  hs_initial_1('green',   1,0, 'up to 6', sub {
     o("    0 ",(-water_cubes_sz(1) * 0.5)," translate\n");
     water_cubes(1);
   });
-  hs_initial_1('yellow',  1,1, sub {
+  hs_initial_1('yellow',  1,1, 'up to 4', sub {
     o("    newpath dykepath\n");
     o("    gsave 0.50 setgray fill grestore\n");
     o("    gsave ",pscolour($c{Colours}{dyke})," fill grestore\n");