use Data::Dumper;
our @paperpts = ('creditcard');
+our @bigpaperpts = ();
our $fontname_num = 'Helvetica';
our $fontscale_num = 0.8;
our $fontname = 'Courier';
usage: $us [<options>] <foo-mail-pregen> <foo-mail-pregen-opts>...
options:
-p<papersize> for libpaper, or "creditcard", default is $paperpts[0]
+ -P<actual-papersize> center in this; default is not to center
-f<bothfont> set both to same font name
-f[<numfont>[*<scale>]],[<addrfont>] default is $fontname_num*$fontscale_num,$fontname
-b<border>|-b<bx>x<by> all in mm
while (m/^-./) {
if (s/^-p(\w+)$//) {
@paperpts = ($1);
+ } elsif (s/^-P(\w+)$//) {
+ @bigpaperpts = ($1);
} elsif (s/^-p($dbl_re)x($dbl_re)$//o) {
@paperpts = mm2pt($1,$2);
+ } elsif (s/^-P($dbl_re)x($dbl_re)$//o) {
+ @bigpaperpts = mm2pt($1,$2);
} elsif (s/^-f($fontname_re)$//o) {
$fontname = $fontname_num = $1;
} elsif (s/^-f(?:($fontname_re)(?:\*($dbl_re))?)?,($fontname_re)?$//o) {
}
canonpaper(\@paperpts);
+canonpaper(\@bigpaperpts);
@borders = mm2pt @borders;
for ($tile[1]=0; $tile[1]<$tiles[1]; $tile[1]++) {
prf "%% tile @tile\n";
prf "gsave\n";
+ if (@bigpaperpts) {
+ foreach (qw(0 1)) {
+ my $spare = $bigpaperpts[$_] - $tiles[$_] * $paperpts[$_];
+ $spare >= 0 or die "too many tiles: will not fit!\n";
+ prf "%s ", $spare*0.5;
+ }
+ prf "translate\n";
+ }
prf "%s ", $tile[$_] * $paperpts[$_] foreach qw(0 1);
prf "translate\n";
write_output_tile($tile[0] * $pertile +