in reply to GD::Graph and Unicode

As far as I can tell, GD::Graph itself doesn't support Unicode; however, it appears that there is some limited support for Unicode in GD---but it's experimental. To quote the author:

"The interaction between Perl, Unicode, and libgd is not clear to me, and you should experiment a bit if you want to use it."

He was referring to the stringFT() method to load and render Truetype fonts. Specifically, the optional "charmap" hashkey. It can have a Unicode value. You can find more info on it in the GD docs under "Character and String Drawing". See:

GD

Replies are listed 'Best First'.
Re^2: GD::Graph and Unicode
by emav (Pilgrim) on Sep 26, 2006 at 15:47 UTC
    Problem solved. Just add the following lines after the new GD::Graph::linespoints object is created. The number next to the font defines the font-size property.

    Of course, unifont.ttf must be a TrueType font file supporting unicode.

    $unifont = "./unifont.ttf"; $my_graph->set_title_font($unifont, 18); $my_graph->set_legend_font($unifont, 12);
    For more methods, visit GD::Graph.
Re^2: GD::Graph and Unicode
by emav (Pilgrim) on Sep 26, 2006 at 12:27 UTC
    Thanks for the hint, Khen1950fx!

    I'll look into it and post again here if I come up with a solution.