+int gfx_render(gfx_canvas_t *canvas,
+ art_u32 width, art_u32 height,
+ gfx_color_t background, FILE *fp){
+ switch (canvas->imgformat) {
+ case IF_PNG:
+ return gfx_render_png (canvas, width, height, background, fp);
+ case IF_SVG:
+ return gfx_render_svg (canvas, width, height, background, fp);
+ default:
+ return -1;
+ }
+}
+
+double gfx_get_text_width ( gfx_canvas_t *canvas,
+ double start, char* font, double size,
+ double tabwidth, char* text){
+ switch (canvas->imgformat) {
+ case IF_PNG:
+ return gfx_get_text_width_libart (canvas, start, font, size, tabwidth, text);
+ default:
+ return size * strlen(text);
+ }
+}
+
+double gfx_get_text_width_libart ( gfx_canvas_t *canvas,
+ double start, char* font, double size,