X-Git-Url: https://git.octo.it/?a=blobdiff_plain;ds=sidebyside;f=src%2Frrd_gfx.c;h=d01b90487a5bbb03edc074e0181b503fe460498c;hb=0dc5d6d50c0d95ba4f04b656358b26518d4ce854;hp=0de62aa5edaafede770b37600cee55ddc1e052be;hpb=c8229ab47939499b92f78a8e27e9874fccb53740;p=rrdtool.git diff --git a/src/rrd_gfx.c b/src/rrd_gfx.c index 0de62aa..d01b904 100644 --- a/src/rrd_gfx.c +++ b/src/rrd_gfx.c @@ -1,5 +1,5 @@ /**************************************************************************** - * RRDtool 1.2.8 Copyright by Tobi Oetiker, 1997-2005 + * RRDtool 1.2.9 Copyright by Tobi Oetiker, 1997-2005 **************************************************************************** * rrd_gfx.c graphics wrapper for rrdtool **************************************************************************/ @@ -7,9 +7,9 @@ /* #define DEBUG */ #ifdef DEBUG -# define DPRINT(x) (void)(printf x, printf("\n")) +# define DPRINTF(x,...) fprintf(stderr, x, ## __VA_ARGS__); #else -# define DPRINT(x) +# define DPRINTF(x,...) #endif #include "rrd_tool.h" #include @@ -451,12 +451,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) { - fprintf (stderr, "couldn't load glyph: %c\n", letter); + DPRINTF("couldn't load glyph: %c\n", letter) continue; } error = FT_Get_Glyph (slot, &glyph->image); if (error) { - fprintf (stderr, "couldn't get glyph %d from slot %d\n", letter, (int)slot); + DPRINTF("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 @@ -478,7 +478,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) { - fprintf (stderr, "couldn't transform glyph id %d\n", letter); + DPRINTF("couldn't transform glyph id %d\n", letter) continue; } @@ -488,7 +488,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) { - fprintf (stderr, "couldn't convert glyph id %d to bitmap\n", letter); + DPRINTF("couldn't convert glyph id %d to bitmap\n", letter) continue; } @@ -635,19 +635,19 @@ int gfx_render_png (gfx_canvas_t *canvas, pen_x += vec.x/64; pen_y += vec.y/64; glyph = string->glyphs; - for(n=0; nnum_glyphs; ++n, ++glyph) { + for(n=0; nnum_glyphs; n++, glyph++) { int gr; FT_Glyph image; FT_BitmapGlyph bit; /* long buf_x,comp_n; */ /* make copy to transform */ if (! glyph->image) { - fprintf (stderr, "no image\n"); + DPRINTF("no image\n") continue; } error = FT_Glyph_Copy (glyph->image, &image); if (error) { - fprintf (stderr, "couldn't copy image\n"); + DPRINTF("couldn't copy image\n") continue; } @@ -1806,6 +1806,7 @@ int gfx_render_eps (gfx_canvas_t *canvas, state.linecap = -1; state.linejoin = -1; state.has_dash = 0; + state.line_width = 1; if (eps_prologue(&state) == -1) return -1; eps_set_color(&state, background);