[rt-users] Bug in Chart fonts handling

Ruslan Zakirov ruz at bestpractical.com
Wed Oct 10 20:33:18 EDT 2007


Actually the changes Jesse's talking about are in 3.6.5 :)

On 10/11/07, Jesse Vincent <jesse at bestpractical.com> wrote:
>
> On Oct 10, 2007, at 10:47 AM, Emmanuel Lacour wrote:
>
> >
> > I played with chart module and found that the fonts settings are
> > incorrect.
> >
> > In share/html/Search/Chart, the only font setting is made by
> > set_legend_font, but there
> > is no legends on graphs so ... not very usefull.
> >
> > Instead it would be better to use one or every of the followings:
> >
>
> We've actually already done a fair bit of this in RT 3.7. I'm hoping
> to start tightening up RT 3.8 for release "soon"
>
> -jesse
>
> > For bars:
> >
> > set_x_label_font
> > set_y_label_font
> > set_x_axis_font
> > set_y_axis_font
> > set_values_font
> >
> > For pies:
> >
> > set_label_font
> > set_value_font
> >
> >
> > Also it's often needed to specify the font path, here is a tested
> > example:
> >
> > use GD::Text;
> > GD::Text->font_path("/usr/share/fonts/truetype/ttf-bitstream-vera");
> >
> > And of course, if those settings can be customized in
> > RT_SiteConfig.pm,
> > it would be very nice ;)
> >
> > That's my two cents...
> >
> >
> > Here is my current diff (RT 3.6.3), also replacing the default non-
> > free (verdana) by free fonts from bitstream:
> >
> > --- ./share/html/Search/Chart 2007-10-10 17:41:24.000000000 +0200
> > +++ ./local/html/Search/Chart 2007-10-10 17:46:00.000000000 +0200
> > @@ -10,6 +10,7 @@
> >  my $chart_class;
> >  use GD;
> >  use GD::Text;
> > +GD::Text->font_path("/usr/share/fonts/truetype/ttf-bitstream-vera");
> >
> >  if ($ChartStyle eq 'pie') {
> >      require GD::Graph::pie;
> > @@ -34,7 +35,15 @@
> >          y_label => 'Tickets',
> >          show_values => 1
> >      );
> > -    $chart->set_legend_font( ['verdana', 'arial',
> > gdMediumBoldFont], 12);
> > +    $chart->set_legend_font( ['VeraBd', 'verdana', 'arial',
> > gdMediumBoldFont], 12);
> > +    $chart->set_x_label_font( ['VeraBd', 'verdana', 'arial',
> > gdMediumBoldFont], 12);
> > +    $chart->set_y_label_font( ['VeraBd', 'verdana', 'arial',
> > gdMediumBoldFont], 12);
> > +    $chart->set_x_axis_font( ['Vera', 'verdana', 'arial',
> > gdMediumBoldFont], 10);
> > +    $chart->set_y_axis_font( ['Vera', 'verdana', 'arial',
> > gdMediumBoldFont], 10);
> > +    $chart->set_values_font( ['Vera', 'verdana', 'arial',
> > gdMediumBoldFont], 10);
> > +} elsif ($chart_class eq "GD::Graph::pie") {
> > +    $chart->set_label_font( ['VeraBd', 'verdana', 'arial',
> > gdMediumBoldFont], 12);
> > +    $chart->set_value_font( ['Vera', 'verdana', 'arial',
> > gdMediumBoldFont], 10);
> >  }
> >
> >  my %class = (
> >
> > _______________________________________________
> > http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
> >
> > Community help: http://wiki.bestpractical.com
> > Commercial support: sales at bestpractical.com
> >
> >
> > Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
> > Buy a copy at http://rtbook.bestpractical.com
> >
>
>
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
> Community help: http://wiki.bestpractical.com
> Commercial support: sales at bestpractical.com
>
>
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
> Buy a copy at http://rtbook.bestpractical.com
>
>


-- 
Best regards, Ruslan.



More information about the rt-users mailing list