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 .= $_ }
29 my $y_cut2d = $y_cutd * ($x_cut2-$x_cut)/$x_cut;
37 my $vhalf = sqrt( $spacing ** 2 - ($colspacing*0.5) ** 2 );
39 my $y_cut = 2.75 * $spacing;
41 my $x_pl_zero = $paper_x*0.5 - 3*$colspacing;
42 my $y_pl_zero = $y_cut + $spacing - $y_cutd* 0.5 * $x_cut/$colspacing;
44 my $y_top = $y_pl_zero + $y_cutd + $spacing*1.25;
46 our $veep_bg = " 0.95 0.90 0.67 setrgbcolor ";
48 sub some_cut_line($) {
58 o <<GS, some_cut_line(<<GR), <<END;
63 $x_cut2 $y_cut2 lineto
64 $x_cut $y_cut2 $y_cut2d add lineto
66 0 $y_cut $y_cutd add lineto
73 my $veep_font = "/Helvetica-Bold findfont 6.5 scalefont setfont";
74 my $money_font = "/Helvetica-BoldOblique findfont 6.5 scalefont setfont";
91 newpath -$sqx -$sqy moveto
94 $sqx -$sqy lineto closepath
100 0.19 0.35 0.25 setrgbcolor
107 ($veeps) dup stringwidth pop -0.5 mul -2.5 rmoveto show
127 my $line_word = 'moveto';
134 foreach (split /\n/, $data) {
138 s{L}{ ($repi == 0 ? 1 : 0) }ge;
139 s{R}{ ($repi == $nrepis-1 ? 1 : 0) }ge;
141 s{V}{ $vhalf / $spacing }ge;
142 my ($x,$y,$money,$veeps,$ruby) = map { eval $_ } split /\s+/;
149 $line .= " $x $y $line_word";
150 $line_word = 'lineto';
151 next unless defined $money;
157 % place $x $y $money $veeps $ruby
162 0 0 chip 0.5 mul 0 360 arc
163 gsave 0.5 setlinewidth $black stroke grestore
164 0.80 0.89 0.63 setrgbcolor fill
167 -4.7 1 moveto ($money) show
172 $o .= <<END if $ruby;
190 0.66 0.85 0.75 setrgbcolor
200 for my $places_i (qw(0 1)) {
201 for my $repi (0..$nrepis-1) {
203 % repi $places_i $repi
205 $repi $colspacing 2 mul mul 0 translate
208 o( (places($repi))[$places_i] );
220 $paper_x $x_cut sub 0 translate
224 o some_cut_line <<END;
227 $paper_x $x_cut sub $y_top lineto
235 $coverup_x $coverup_y translate
236 /Times-Roman findfont 4.0 scalefont setfont
237 0 8 moveto (cover) show
238 2 4.5 moveto (up) show
240 /Helvetica-Bold-Italic findfont 3.5 scalefont setfont (35) show
242 /Helvetica-Bold findfont 3.5 scalefont setfont (15) show
246 $paper_x $x_cut sub $y_top 7 sub translate
249 arrowlen 2 add neg 0 translate
250 ${\ arrow_any("arrowlen 0 moveto -30 0 rlineto") }
254 /Helvetica-Bold findfont 6.5 scalefont setfont
264 /Times-Roman findfont 4.5 scalefont setfont
273 gsave 0 $y_top translate
280 print $ps_framing or die $!;