|
|
@ -5,14 +5,31 @@ use Text::Wrap; |
|
|
|
$Text::Wrap::columns = 30; |
|
|
|
$Text::Wrap::columns = 30; |
|
|
|
|
|
|
|
|
|
|
|
my $cards = LoadFile('shopping.yml'); |
|
|
|
my $cards = LoadFile('shopping.yml'); |
|
|
|
$bgcolour = $cards->{Deck}->{Background}; |
|
|
|
if($cards->{Deck}->{Background}){ |
|
|
|
$mainfont = $cards->{Deck}->{Font}; |
|
|
|
$bgcolour = $cards->{Deck}->{Background}; |
|
|
|
$txtcolour = $cards->{Deck}->{TextColour}; |
|
|
|
}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}}){ |
|
|
|
foreach my $card (keys %{$cards->{Deck}->{Cards}}){ |
|
|
|
my $image = Image::Magick->new(size=>'600x825'); |
|
|
|
my $image = Image::Magick->new(size=>'600x825'); |
|
|
|
$image->ReadImage('canvas:' . $bgcolour); |
|
|
|
$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; |
|
|
|
my $surface = Image::Magick->new; |
|
|
|
$surface->Rotate(90); |
|
|
|
$surface->Rotate(90); |
|
|
|
$surface->Resize('600x825!'); |
|
|
|
$surface->Resize('600x825!'); |
|
|
|