X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Frrd_gfx.c;h=d26e3cb317a14b401cfdaa3ebfc594205f781aa0;hb=155eeedf23685ed46c5c6660c8e7766927e0057b;hp=bf60ddc86d5bd4d4e4b9afd7b4097ffde2eb53aa;hpb=f8b321ed9be936455166a5e9297199e84b048526;p=rrdtool.git diff --git a/src/rrd_gfx.c b/src/rrd_gfx.c index bf60ddc..d26e3cb 100644 --- a/src/rrd_gfx.c +++ b/src/rrd_gfx.c @@ -1,5 +1,5 @@ /**************************************************************************** - * RRDtool 1.2rc7 Copyright by Tobi Oetiker, 1997-2005 + * RRDtool 1.2.0 Copyright by Tobi Oetiker, 1997-2005 **************************************************************************** * rrd_gfx.c graphics wrapper for rrdtool **************************************************************************/ @@ -372,7 +372,6 @@ gfx_string gfx_string_create(FT_Face face,const char *text, unsigned int n; int error; int gottab = 0; - ft_pen.x = 0; /* start at (0,0) !! */ ft_pen.y = 0; @@ -390,12 +389,13 @@ gfx_string gfx_string_create(FT_Face face,const char *text, use_kerning = FT_HAS_KERNING(face); previous = 0; glyph = string->glyphs; - for (n=0; ncount; n++, glyph++) { + for (n=0; ncount;glyph++) { FT_Vector vec; /* handle the tabs ... have a witespace glyph inserted, but set its width such that the distance of the new right edge is x times tabwidth from 0,0 where x is an integer. */ - char letter = text[n]; + unsigned char letter = text[n]; + gottab = 0; if (letter == '\\' && n+1 < string->count && text[n+1] == 't'){ /* we have a tab here so skip the backslash and @@ -470,16 +470,19 @@ gfx_string gfx_string_create(FT_Face face,const char *text, /* increment number of glyphs */ previous = glyph->index; string->num_glyphs++; + n++; + } /* printf ("number of glyphs = %d\n", string->num_glyphs);*/ compute_string_bbox( string ); /* the last character was a tab */ - if (gottab) { + /* if (gottab) { */ string->width = ft_pen.x; - } else { + /* } else { string->width = string->bbox.xMax - string->bbox.xMin; - } + } */ string->height = string->bbox.yMax - string->bbox.yMin; + return string; } @@ -762,9 +765,9 @@ static int gfx_save_png (art_u8 *buffer, FILE *fp, long width, long height, lon png_set_text (png_ptr, info_ptr, text, 1); /* lets make this fast */ - png_set_filter(png_ptr,0,PNG_FILTER_NONE); + /* png_set_filter(png_ptr,0,PNG_FILTER_NONE); */ png_set_compression_level(png_ptr,1); - png_set_compression_strategy(png_ptr,Z_HUFFMAN_ONLY); + /* png_set_compression_strategy(png_ptr,Z_HUFFMAN_ONLY); */ /* png_set_filter(png_ptr,PNG_FILTER_TYPE_BASE,PNG_FILTER_SUB); png_set_compression_strategy(png_ptr,Z_HUFFMAN_ONLY); @@ -1379,7 +1382,7 @@ static int eps_prologue(eps_state *state) gfx_node_t *node; fputs( "%!PS-Adobe-3.0 EPSF-3.0\n" - "%%Creator: RRDtool 1.2rc7 Tobias Oetiker, http://tobi.oetiker.ch\n" + "%%Creator: RRDtool 1.2.0 Tobias Oetiker, http://tobi.oetiker.ch\n" /* can't like weird chars here */ "%%Title: (RRDtool output)\n" "%%DocumentData: Clean7Bit\n"