2 # Books of Pumpkins, etc. Extensions to Quacks of Quedlinburg
3 # SPDX-License-Identifier: GPL-3.0-or-later OR CC-BY-SA-4.0
4 # Copyright 2020-2022 Ian Jackson
8 BEGIN { unshift @INC, '.'; }
13 for (@_) { $ps_framing .= $_ }
32 my $vhalf = sqrt( $spacing ** 2 - ($colspacing*0.5) ** 2 );
34 my $y_cut = 2.75 * $spacing;
36 my $x_pl_zero = $paper_x*0.5 - 3*$colspacing;
37 my $y_pl_zero = $y_cut + $spacing - $y_cutd* 0.5 * $x_cut/$colspacing;
39 my $y_top = $y_pl_zero + $y_cutd + $spacing*1.25;
41 our $veep_bg = " 0.95 0.90 0.67 setrgbcolor ";
43 sub some_cut_line($) {
53 o <<GS, some_cut_line(<<GR), <<END;
58 $x_cut2 $y_cut2 lineto
61 0 $y_cut $y_cutd add lineto
68 my $veep_font = "/Helvetica-Bold findfont 6.5 scalefont setfont";
69 my $money_font = "/Helvetica-BoldOblique findfont 6.5 scalefont setfont";
86 newpath -$sqx -$sqy moveto
89 $sqx -$sqy lineto closepath
95 0.19 0.35 0.25 setrgbcolor
102 ($veeps) dup stringwidth pop -0.5 mul -2.5 rmoveto show
122 my $line_word = 'moveto';
129 foreach (split /\n/, $data) {
133 s{L}{ ($repi == 0 ? 1 : 0) }ge;
134 s{R}{ ($repi == $nrepis-1 ? 1 : 0) }ge;
136 s{V}{ $vhalf / $spacing }ge;
137 my ($x,$y,$money,$veeps,$ruby) = map { eval $_ } split /\s+/;
144 $line .= " $x $y $line_word";
145 $line_word = 'lineto';
146 next unless defined $money;
152 % place $x $y $money $veeps $ruby
157 0 0 chip 0.5 mul 0 360 arc
158 gsave 0.5 setlinewidth $black stroke grestore
159 0.80 0.89 0.63 setrgbcolor fill
162 -4.7 1 moveto ($money) show
167 $o .= <<END if $ruby;
185 0.66 0.85 0.75 setrgbcolor
195 for my $places_i (qw(0 1)) {
196 for my $repi (0..$nrepis-1) {
198 % repi $places_i $repi
200 $repi $colspacing 2 mul mul 0 translate
203 o( (places($repi))[$places_i] );
215 $paper_x $x_cut sub 0 translate
219 o some_cut_line <<END;
222 $paper_x $x_cut sub $y_top lineto
230 /Times-Roman findfont 4.0 scalefont setfont
231 4 97 moveto (cover) show
232 6 93.5 moveto (up) show
234 /Helvetica-Bold-Italic findfont 3.5 scalefont setfont (35) show
236 /Helvetica-Bold findfont 3.5 scalefont setfont (15) show
240 $paper_x $x_cut sub $y_top 7 sub translate
243 arrowlen 2 add neg 0 translate
244 ${\ arrow_any("arrowlen 0 moveto -30 0 rlineto") }
248 /Helvetica-Bold findfont 6.5 scalefont setfont
258 /Times-Roman findfont 4.5 scalefont setfont
267 gsave 0 $y_top translate
274 print $ps_framing or die $!;