From f1020f3096ecff934ad93bb78ba597ff4249e068 Mon Sep 17 00:00:00 2001 From: cos Date: Sun, 25 Jan 2015 23:36:46 +0100 Subject: Optimize strings on labels, to prepare to fit more information. --- mat | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mat b/mat index 898f957..09aa559 100755 --- a/mat +++ b/mat @@ -282,18 +282,18 @@ sub print_label { my $iconv = Text::Iconv->new("UTF-8", "ISO8859-1"); my $latin1_dish = $iconv->convert($dish_name); - my $row0 = $Config{'label_name'}; + my $row0 = $Config{'label_name'}." ".$preparation_date; my $row1; my $row2; if( length($latin1_dish) < 15) { $row1 = $latin1_dish; - $row2 = ""; + $row2 = "(".$amount."g)"; } else { $row1 = $latin1_dish; $row1 =~ s/(.{15,23}) .*/$1/; - $row2 = substr($latin1_dish, (length $row1) + 1); + $row2 = substr($latin1_dish, (length $row1) + 1).' ('.$amount.'g)'; } - my $row3 = $preparation_date.' ('.$amount.'g)'; + my $row3 = ''; my $idbarcode = GD::Barcode::QRcode->new(sprintf("%s%d", $Config{'label_id_prefix'}, $id), { Version=>3 }); my $idbarcode_image=$idbarcode->plot(); -- cgit v1.2.3