UTF8 problem in GD::Graph (Bug 287682)

Jacques Supcik jacques at supcik.org
Wed Jul 29 21:38:32 UTC 2009


I found a way to solve the UTF8 problem in GD::Graph
(https://bugzilla.mozilla.org/show_bug.cgi?id=287682)

* define FONT_PATH in apache config: (for example, on my Ubuntu machine)

| FONT_PATH /usr/share/fonts/truetype/msttcorefonts

* in all the "template/.../default/reports/report-*.png.tmpl" define the
fonts:

|  graph.set_title_font(['verdana', 'arial'], 8);
|  graph.set_x_label_font(['verdana', 'arial'], 8);
|  graph.set_y_label_font(['verdana', 'arial'], 8);
|  graph.set_x_axis_font(['verdana', 'arial'], 8);
|  graph.set_y_axis_font(['verdana', 'arial'], 8);
|  graph.set_y_values_font(['verdana', 'arial'], 8);
|  graph.set_legend_font(['verdana', 'arial'], 8);

GD::Text will then use the TrueType font if available and will work with
UTF8.

I just tried and it works.

What do you think about this approach?

P.S. I don't really like the idea of defining the FONT_PATH in the
apache config. Would it be a good idea to add an option in the parameters?)

Thank you in advance for your feedback.

-- Jacques.




More information about the developers mailing list