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 .= $_ }
26 my $y_cut2d = $y_cutd * ($x_cut2-$x_cut)/$x_cut;
34 my $vhalf = sqrt( $spacing ** 2 - ($colspacing*0.5) ** 2 );
36 my $y_cut = 2.75 * $spacing;
38 my $x_pl_zero = $paper_x*0.5 - 3*$colspacing;
39 my $y_pl_zero = $y_cut + $spacing - $y_cutd* 0.5 * $x_cut/$colspacing;
41 my $y_top = $y_pl_zero + $y_cutd + $spacing*1.25;
43 our $veep_bg = " 0.95 0.90 0.67 setrgbcolor ";
45 sub some_cut_line($) {
55 o <<GS, some_cut_line(<<GR), <<END;
60 $x_cut2 $y_cut2 lineto
61 $x_cut $y_cut2 $y_cut2d add lineto
63 0 $y_cut $y_cutd add lineto
70 my $veep_font = "/Helvetica-Bold findfont 6.5 scalefont setfont";
71 my $money_font = "/Helvetica-BoldOblique findfont 6.5 scalefont setfont";
88 newpath -$sqx -$sqy moveto
91 $sqx -$sqy lineto closepath
97 0.19 0.35 0.25 setrgbcolor
104 ($veeps) dup stringwidth pop -0.5 mul -2.5 rmoveto show
124 my $line_word = 'moveto';
131 foreach (split /\n/, $data) {
135 s{L}{ ($repi == 0 ? 1 : 0) }ge;
136 s{R}{ ($repi == $nrepis-1 ? 1 : 0) }ge;
138 s{V}{ $vhalf / $spacing }ge;
139 my ($x,$y,$money,$veeps,$ruby) = map { eval $_ } split /\s+/;
146 $line .= " $x $y $line_word";
147 $line_word = 'lineto';
148 next unless defined $money;
154 % place $x $y $money $veeps $ruby
159 0 0 chip 0.5 mul 0 360 arc
160 gsave 0.5 setlinewidth $black stroke grestore
161 0.80 0.89 0.63 setrgbcolor fill
164 -4.7 1 moveto ($money) show
169 $o .= <<END if $ruby;
187 0.66 0.85 0.75 setrgbcolor
197 for my $places_i (qw(0 1)) {
198 for my $repi (0..$nrepis-1) {
200 % repi $places_i $repi
202 $repi $colspacing 2 mul mul 0 translate
205 o( (places($repi))[$places_i] );
217 $paper_x $x_cut sub 0 translate
221 o some_cut_line <<END;
224 $paper_x $x_cut sub $y_top lineto
232 /Times-Roman findfont 4.0 scalefont setfont
233 4 97 moveto (cover) show
234 6 93.5 moveto (up) show
236 /Helvetica-Bold-Italic findfont 3.5 scalefont setfont (35) show
238 /Helvetica-Bold findfont 3.5 scalefont setfont (15) show
242 $paper_x $x_cut sub $y_top 7 sub translate
245 arrowlen 2 add neg 0 translate
246 ${\ arrow_any("arrowlen 0 moveto -30 0 rlineto") }
250 /Helvetica-Bold findfont 6.5 scalefont setfont
260 /Times-Roman findfont 4.5 scalefont setfont
269 gsave 0 $y_top translate
276 print $ps_framing or die $!;