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 .= $_ }
30 my $vhalf = sqrt( $spacing ** 2 - ($colspacing*0.5) ** 2 );
32 my $y_cut = 2.75 * $spacing;
34 my $x_pl_zero = $paper_x*0.5 - 3*$colspacing;
35 my $y_pl_zero = $y_cut + $spacing - $y_cutd* 0.5 * $x_cut/$colspacing;
37 my $y_top = $y_pl_zero + $y_cutd + $spacing*1.25;
39 our $veep_bg = " 0.95 0.90 0.67 setrgbcolor ";
41 sub some_cut_line($) {
51 o <<GS, some_cut_line(<<GR), <<END;
57 0 $y_cut $y_cutd add lineto
64 my $veep_font = "/Helvetica-Bold findfont 6.5 scalefont setfont";
65 my $money_font = "/Helvetica-BoldOblique findfont 6.5 scalefont setfont";
82 newpath -$sqx -$sqy moveto
85 $sqx -$sqy lineto closepath
91 0.19 0.35 0.25 setrgbcolor
98 ($veeps) dup stringwidth pop -0.5 mul -2.5 rmoveto show
118 my $line_word = 'moveto';
125 foreach (split /\n/, $data) {
129 s{L}{ ($repi == 0 ? 1 : 0) }ge;
130 s{R}{ ($repi == $nrepis-1 ? 1 : 0) }ge;
132 s{V}{ $vhalf / $spacing }ge;
133 my ($x,$y,$money,$veeps,$ruby) = map { eval $_ } split /\s+/;
140 $line .= " $x $y $line_word";
141 $line_word = 'lineto';
142 next unless defined $money;
148 % place $x $y $money $veeps $ruby
153 0 0 chip 0.5 mul 0 360 arc
154 gsave 0.5 setlinewidth $black stroke grestore
155 0.80 0.89 0.63 setrgbcolor fill
158 -4.7 1 moveto ($money) show
163 $o .= <<END if $ruby;
181 0.66 0.85 0.75 setrgbcolor
191 for my $places_i (qw(0 1)) {
192 for my $repi (0..$nrepis-1) {
194 % repi $places_i $repi
196 $repi $colspacing 2 mul mul 0 translate
199 o( (places($repi))[$places_i] );
211 $paper_x $x_cut sub 0 translate
215 o some_cut_line <<END;
218 $paper_x $x_cut sub $y_top lineto
226 /Times-Roman findfont 4.0 scalefont setfont
227 4 97 moveto (cover) show
228 6 93.5 moveto (up) show
230 /Helvetica-Bold-Italic findfont 3.5 scalefont setfont (35) show
232 /Helvetica-Bold findfont 3.5 scalefont setfont (15) show
236 $paper_x $x_cut sub $y_top 7 sub translate
239 arrowlen 2 add neg 0 translate
240 ${\ arrow_any("arrowlen 0 moveto -30 0 rlineto") }
244 /Helvetica-Bold findfont 6.5 scalefont setfont
254 /Times-Roman findfont 4.5 scalefont setfont
263 gsave 0 $y_top translate
270 print $ps_framing or die $!;