diff --git a/program/src/rrd_gfx.c b/program/src/rrd_gfx.c
index e1694d3cadee38dd0fb8c8c04a76d2b1220b05c3..c251c0ef967b15f3659f7e616c3c0d044db41fc7 100644 (file)
--- a/program/src/rrd_gfx.c
+++ b/program/src/rrd_gfx.c
/****************************************************************************
- * RRDtool 1.2.18 Copyright by Tobi Oetiker, 1997-2006
+ * RRDtool 1.2.30 Copyright by Tobi Oetiker, 1997-2009
****************************************************************************
* rrd_gfx.c graphics wrapper for rrdtool
**************************************************************************/
/* stupid MSVC doesnt support variadic macros = no debug for now! */
#ifdef _MSC_VER
-# define DPRINTF()
+# define RRDPRINTF()
#else
# ifdef DEBUG
-# define DPRINTF(...) fprintf(stderr, __VA_ARGS__);
+# define RRDPRINTF(...) fprintf(stderr, __VA_ARGS__);
# else
-# define DPRINTF(...)
+# define RRDPRINTF(...)
# endif /* DEBUG */
#endif /* _MSC_VER */
#include "rrd_tool.h"
@@ -466,12 +466,12 @@ gfx_string gfx_string_create(gfx_canvas_t *canvas, FT_Face face,const char *text
canvas->aa_type == AA_LIGHT ? FT_LOAD_TARGET_LIGHT :
FT_LOAD_TARGET_MONO : FT_LOAD_TARGET_MONO);
if (error) {
- DPRINTF("couldn't load glyph: %c\n", letter)
+ RRDPRINTF("couldn't load glyph: %c\n", letter)
continue;
}
error = FT_Get_Glyph (slot, &glyph->image);
if (error) {
- DPRINTF("couldn't get glyph %c from slot %d\n", letter, (int)slot)
+ RRDPRINTF("couldn't get glyph %c from slot %d\n", letter, (int)slot)
continue;
}
/* if we are in tabbing mode, we replace the tab with a space and shift the position
@@ -493,7 +493,7 @@ gfx_string gfx_string_create(gfx_canvas_t *canvas, FT_Face face,const char *text
FT_Vector_Transform (&vec, &string->transform);
error = FT_Glyph_Transform (glyph->image, &string->transform, &vec);
if (error) {
- DPRINTF("couldn't transform glyph id %d\n", letter)
+ RRDPRINTF("couldn't transform glyph id %d\n", letter)
continue;
}
@@ -503,7 +503,7 @@ gfx_string gfx_string_create(gfx_canvas_t *canvas, FT_Face face,const char *text
canvas->aa_type == AA_LIGHT ? FT_RENDER_MODE_LIGHT :
FT_RENDER_MODE_MONO : FT_RENDER_MODE_MONO, 0, 1);
if (error) {
- DPRINTF("couldn't convert glyph id %d to bitmap\n", letter)
+ RRDPRINTF("couldn't convert glyph id %d to bitmap\n", letter)
continue;
}
(long)(node->size*64),
(long)(100*canvas->zoom),
(long)(100*canvas->zoom));
- if ( error ) break;
+ if ( error ) {
+ FT_Done_Face(face);
+ break;
+ }
pen_x = node->x * canvas->zoom;
pen_y = node->y * canvas->zoom;
string = gfx_string_create (canvas, face, node->text, node->angle, node->tabwidth, node->size);
+ FT_Done_Face(face);
+
switch(node->halign){
case GFX_H_RIGHT: vec.x = -string->bbox.xMax;
break;
/* long buf_x,comp_n; */
/* make copy to transform */
if (! glyph->image) {
- DPRINTF("no image\n")
+ RRDPRINTF("no image\n")
continue;
}
error = FT_Glyph_Copy (glyph->image, &image);
if (error) {
- DPRINTF("couldn't copy image\n")
+ RRDPRINTF("couldn't copy image\n")
continue;
}
PNG_FILTER_TYPE_DEFAULT);
text[0].key = "Software";
- text[0].text = "RRDtool, Tobias Oetiker <tobi@oetike.ch>, http://tobi.oetiker.ch";
+ text[0].text = "RRDtool, Tobias Oetiker <tobi@oetiker.ch>, http://tobi.oetiker.ch";
text[0].compression = PNG_TEXT_COMPRESSION_NONE;
png_set_text (png_ptr, info_ptr, text, 1);