|
|
|
@ -5,14 +5,31 @@ use Text::Wrap; |
|
|
|
|
$Text::Wrap::columns = 30; |
|
|
|
|
|
|
|
|
|
my $cards = LoadFile('shopping.yml'); |
|
|
|
|
if($cards->{Deck}->{Background}){ |
|
|
|
|
$bgcolour = $cards->{Deck}->{Background}; |
|
|
|
|
}else{ |
|
|
|
|
$bgcolour='white'; |
|
|
|
|
} |
|
|
|
|
if($cards->{Deck}->{Font}){ |
|
|
|
|
$mainfont = $cards->{Deck}->{Font}; |
|
|
|
|
}else{ |
|
|
|
|
$mainfont = 'Courier'; |
|
|
|
|
} |
|
|
|
|
if($cards->{Deck}->{TextColour}){ |
|
|
|
|
$txtcolour = $cards->{Deck}->{TextColour}; |
|
|
|
|
}else{ |
|
|
|
|
$txtcolour = 'black'; |
|
|
|
|
} |
|
|
|
|
if($cards->{Deck}->{BorderColour}){ |
|
|
|
|
$bordercolour = $cards->{Deck}->{BorderColour}; |
|
|
|
|
}else{ |
|
|
|
|
$bordercolour = 'red'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
foreach my $card (keys %{$cards->{Deck}->{Cards}}){ |
|
|
|
|
my $image = Image::Magick->new(size=>'600x825'); |
|
|
|
|
$image->ReadImage('canvas:' . $bgcolour); |
|
|
|
|
$image->Draw(stroke=>'red', fill => 'none', strokewidth=>1, primitive=>'rectangle', points=>'38,38 562,787'); |
|
|
|
|
$image->Draw(stroke=>$bordercolour, fill => 'none', strokewidth=>1, primitive=>'rectangle', points=>'38,38 562,787'); |
|
|
|
|
my $surface = Image::Magick->new; |
|
|
|
|
$surface->Rotate(90); |
|
|
|
|
$surface->Resize('600x825!'); |
|
|
|
|