$ps_framing
- $page_pre ps_head
+ $page_pre ps_start
- arrow_any
+ arrow_any chip ruby
);
our $anychip = ['0.8', '0'];
our $black = colour('0');
-our $page_pre = <<END;
-72 25.4 div dup scale
-%210 0 translate
-%90 rotate
-7 30 translate
-END
+our $page_pre;
our $ps_framing = '';
END
};
-sub ps_head () {
+sub chip ($$) {
+ my ($cary, $pips) = @_; # put in a gsave translate
+ my $o = <<END;
+ newpath
+ 0 0 chip 0.5 mul 0 360 arc
+ gsave 1 setlinewidth $black stroke grestore
+ ${\ colour($cary->[0]) } fill
+END
+ if ($pips) {
+ $o .= <<END;
+ ${\ colour($cary->[1]) }
+END
+ }
+ my $spot = sub {
+ my ($x,$y) = @_;
+ $o .= <<END;
+ newpath
+ spot 0.5 sqrt mul 1.1 mul dup
+ $x mul exch $y mul
+ spot 0.5 mul
+ 0 360 arc fill
+END
+ };
+
+ $spot->( 0, 0) if $pips & 1;
+ $spot->(-1,-1) if $pips & 6;
+ $spot->(+1,+1) if $pips & 6;
+ $spot->(-1,+1) if $pips & 4;
+ $spot->(+1,-1) if $pips & 4;
+
+ $o;
+}
+
+sub ruby () { # put in gsave translate
+ <<END;
+ newpath
+ rubysz neg 0 moveto
+ 0 rubysz neg lineto
+ rubysz 0 lineto
+ 0 rubysz lineto
+ closepath
+ ${\ colour('1 .2 .2') } gsave fill grestore
+ $black 1 setlinewidth stroke
+END
+}
+
+sub ps_start (;$) {
+ my ($adj) = @_;
+ $adj //= '';
+
+ $page_pre = <<END;
+72 25.4 div dup scale
+%210 0 translate
+%90 rotate
+$adj
+END
+
$ps_framing .= <<END;
%!