use open ':utf8';
+my $font_file = '/usr/share/fonts/truetype/freefont/FreeSans.ttf';
my ($count, $config, $sleep_interval, $lockfile, $daemon) = (1, 'SYSCONFDIR/opensrf_core.xml', 10, '/tmp/reporter-LOCK');
"concurrency=i" => \$count,
"bootstrap|boostrap=s" => \$config,
"lockfile=s" => \$lockfile,
+ "font" => \$font_file,
);
if (-e $lockfile) {
#-------------------------------------------------------------------
+sub set_gd_fonts {
+ my $pic = shift;
+ return if (! -e $font_file);
+ $pic->set_title_font($font_file, 14);
+ $pic->set_legend_font($font_file, 8);
+ $pic->set_x_axis_font($font_file, 8);
+ $pic->set_x_label_font($font_file, 10);
+ $pic->set_y_axis_font($font_file, 8);
+ $pic->set_y_label_font($font_file, 8);
+}
+
sub send_success {
my $r = shift;
open F, $success_template or die "Cannot read '$success_template'";
return unless ($csv);
my $f = new FileHandle (">$file") or die "Cannot write to '$file'";
+ binmode($f, ':utf8');
$csv->print($f, $r->{column_labels});
$csv->print($f, $_) for (@{$r->{data}});
my $r = shift;
my $index = new FileHandle (">$file") or die "Cannot write to '$file'";
+ binmode($index, ':utf8');
# index header
print $index <<" HEADER";
push @links, "<a class='dim' href='report-data.html.debug.html'>Debugging Info</a>";
my $debug = new FileHandle (">$file.debug.html") or die "Cannot write to '$file.debug.html'";
+ binmode($debug, ':utf8');
print $debug "<html><head><meta charset='utf-8'><title>DEBUG: $$r{report}{name}</title></head><body>";
{ no warnings;
if ($r->{html_format}) {
# create the raw output html file
my $raw = new FileHandle (">$file.raw.html") or die "Cannot write to '$file.raw.html'";
+ binmode($raw, ':utf8');
print $raw "<html><head><meta charset='utf-8'><title>$$r{report}{name}</title>";
print $raw <<' CSS';
}
my $pic = new GD::Graph::pie;
-
+ set_gd_fonts($pic);
$pic->set(
label => $r->{column_labels}->[$vcol],
start_angle => 180,
$h = 0 if ($h < 0);
my $pic = new GD::Graph::bars3d ($w + 250, $h + 500);
-
+ set_gd_fonts($pic);
$pic->set(
title => $r->{report}{name},
x_labels_vertical => 1,
$h = 0 if ($h < 0);
my $pic = new GD::Graph::lines3d ($w + 250, $h + 500);
-
+ set_gd_fonts($pic);
$pic->set(
title => $r->{report}{name},
x_labels_vertical => 1,