14 |
my $h_base=13; |
my $h_base=13; |
15 |
my $h; |
my $h; |
16 |
|
|
17 |
|
my $dir="/data/pliva-si/m"; |
18 |
|
#my $font="arialbd.ttf"; |
19 |
|
my $font="trebucbd.ttf"; |
20 |
|
|
21 |
my %iso2utf_tab = ( |
my %iso2utf_tab = ( |
22 |
'¹' => 0x0161, 'ð' => 0x0111, 'è' => 0x010d, 'æ' => 0x0107, '¾' => 0x017e, |
'¹' => 0x0161, 'ð' => 0x0111, 'è' => 0x010d, 'æ' => 0x0107, '¾' => 0x017e, |
23 |
'©' => 0x0160, 'Ð' => 0x0110, 'È' => 0x010c, 'Æ' => 0x0106, '®' => 0x017d |
'©' => 0x0160, 'Ð' => 0x0110, 'È' => 0x010c, 'Æ' => 0x0106, '®' => 0x017d |
54 |
$text=iso2utf($text); |
$text=iso2utf($text); |
55 |
if ($type == TYPE_BULLET) { |
if ($type == TYPE_BULLET) { |
56 |
$image->Annotate('text' => $text, 'geometry' => '+17+10', |
$image->Annotate('text' => $text, 'geometry' => '+17+10', |
57 |
'font' => "\@arialbd.ttf", 'pointsize' => 11, |
'font' => "\@$dir/$font", 'pointsize' => 11, |
58 |
'fill' => '#ffffff', 'align' => 'left'); |
'fill' => '#ffffff', 'align' => 'left'); |
59 |
# $image->Annotate('text' => $text, 'geometry' => '+17+1', |
# $image->Annotate('text' => $text, 'geometry' => '+17+1', |
60 |
# 'font' => "\@arialbd.ttf", 'pointsize' => 11, |
# 'font' => "\@$dir/$font", 'pointsize' => 11, |
61 |
# 'pen' => '#FFFFFF', 'align' => 'left'); |
# 'pen' => '#FFFFFF', 'align' => 'left'); |
62 |
# $image->Blur('radius' => 0.1); |
# $image->Blur('radius' => 0.1); |
63 |
$image->Draw('primitive' => 'rectangle', 'stroke' => '#00D000', |
$image->Draw('primitive' => 'rectangle', 'stroke' => '#00D000', |
65 |
'7,4 10,7'); |
'7,4 10,7'); |
66 |
} elsif ($type == TYPE_BLUEDOT) { |
} elsif ($type == TYPE_BLUEDOT) { |
67 |
$image->Annotate('text' => $text, 'geometry' => '+17+10', |
$image->Annotate('text' => $text, 'geometry' => '+17+10', |
68 |
'font' => "\@arialbd.ttf", 'pointsize' => 11, |
'font' => "\@$dir/$font", 'pointsize' => 11, |
69 |
'fill' => '#ffffff', 'align' => 'left'); |
'fill' => '#ffffff', 'align' => 'left'); |
70 |
$image->Draw('primitive' => 'rectangle', 'stroke' => '#00b2dc', |
$image->Draw('primitive' => 'rectangle', 'stroke' => '#00b2dc', |
71 |
'fill' => '#00b2dc', 'antialias' => 1, 'points' => |
'fill' => '#00b2dc', 'antialias' => 1, 'points' => |
93 |
} |
} |
94 |
} |
} |
95 |
$image->Annotate('text' => $text, 'geometry' => '+3+10', |
$image->Annotate('text' => $text, 'geometry' => '+3+10', |
96 |
'font' => "\@arialbd.ttf", 'pointsize' => 11, |
'font' => "\@$dir/$font", 'pointsize' => 11, |
97 |
'fill' => '#FFFFFF', 'align' => 'left'); |
'fill' => '#FFFFFF', 'align' => 'left'); |
98 |
# $image->Blur('radius' => 1); |
# $image->Blur('radius' => 1); |
99 |
} |
} |
100 |
print " -> " unless ($file eq "-"); |
print " -> " unless ($file eq "-"); |
101 |
$file .= ".gif" unless ($file eq "-"); |
$file .= ".gif" unless ($file eq "-"); |
102 |
$image->Write('filename' => "gif:$file", 'colors' => 256, |
$image->Write('filename' => "gif:$dir/$file", 'colors' => 256, |
103 |
'interlace' => "none", 'compress' => 'lzw'); |
'interlace' => "none", 'compress' => 'lzw'); |
104 |
print "$file\n" unless ($file eq "-"); |
print "$file\n" unless ($file eq "-"); |
105 |
return "$file"; |
return "$file"; |
110 |
#exit $?; |
#exit $?; |
111 |
|
|
112 |
# |
# |
113 |
my $dbh = DBI->connect("DBI:Pg:dbname=plivasi", "", "") || |
my $dbh = DBI->connect("DBI:Pg:dbname=plivasi", "dpavlin", "") || |
114 |
die $DBI::errstr; |
die $DBI::errstr; |
115 |
my $sth = $dbh->prepare("SELECT section,item,url,level,num FROM menu") || |
my $sth = $dbh->prepare("SELECT section,item,url,level,num FROM menu") || |
116 |
die $dbh->errstr(); |
die $dbh->errstr(); |