kean has asked for the wisdom of the Perl Monks concerning the following question:

I tried the module Chart(::StackedBars) and want to use othe fonts than the GD Fonts for title, legend etc.. The GD Package from Bribes i use is compiled with TrueType support. How can i use this with chart?? Here my Samplecode:
use Chart::StackedBars; # (type is one of: Points, Lines, Bars, Line +sPoints, Composite,StackedBars, Mountain, Pie, HorizontalBars, Split, + ErrorBars, Pareto, Direction) use GD; $obj = Chart::StackedBars->new (740,430); $obj->set ( 'title' => "Overview", 'legend' => 'none', 'y_grid_lines' => 'true', 'title_font' => GD::Font->Large, 'precision' => 0, 'min_val' => 0, 'colors' => {'grid_lines' => [192,192,192]} ); @data = ( [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'S +ep', 'Oct', 'Nov', 'Dez' ], [ 150, 180, 210, 190, 175 ] ); $obj->png ( "chart.png", \@data );

Replies are listed 'Best First'.
Re: [Chart] GD::Font TrueType
by zentara (Cardinal) on Apr 12, 2012 at 15:31 UTC
    Just hazarding a guess... :-)

    I'm on linux, and when I need to use a TrueType font, I usually need to put the font in the same directory as the script. Otherwise, you need to specify the full system path to the font, which can widely vary from system to system. Try grabbing a copy of the Truetype font you want to use, and put it in your script's directory, and see if it works for you.


    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku ................... flash japh
Re: [Chart] GD::Font TrueType
by BrowserUk (Patriarch) on Apr 12, 2012 at 18:52 UTC

    See Font question regarding GD.pm for example of getting at truetype fonts on Windows, and Re: Font size in GD::Graph module for some examples of using fonts with GD::Graph.

    I swear I have a more recent examples of fonts and GD::Graph kicking around, but Google seems to think its golden oldies day today.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    The start of some sanity?