From 9a53d9b6fb9bb60bd658760125f652fedc5b6f9b Mon Sep 17 00:00:00 2001 From: oetiker Date: Sun, 1 May 2005 13:19:39 +0000 Subject: [PATCH] the multibyte support tried did not work ... takeing it out again git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2@467 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/src/rrd_gfx.c | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/program/src/rrd_gfx.c b/program/src/rrd_gfx.c index 045892aa..becab8c9 100644 --- a/program/src/rrd_gfx.c +++ b/program/src/rrd_gfx.c @@ -372,10 +372,6 @@ gfx_string gfx_string_create(FT_Face face,const char *text, unsigned int n; int error; int gottab = 0; - #ifdef HAVE_MBSTOWCS - wchar_t* w_text; - #endif - ft_pen.x = 0; /* start at (0,0) !! */ ft_pen.y = 0; @@ -390,20 +386,16 @@ gfx_string gfx_string_create(FT_Face face,const char *text, string->transform.yx = (FT_Fixed)( sin(M_PI*(rotation)/180.0)*0x10000); string->transform.yy = (FT_Fixed)( cos(M_PI*(rotation)/180.0)*0x10000); - #ifdef HAVE_MBSTOWCS - w_text = (wchar_t) calloc (string->count,sizeof(wchar_t)); - mbstowcs(w_text,text,string->count); - #endif - 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. */ 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 @@ -422,11 +414,7 @@ gfx_string gfx_string_create(FT_Face face,const char *text, glyph->pos.y = 0; glyph->image = NULL; -#ifdef HAVE_MBSTOWCS - glyph->index = FT_Get_Char_Index( face, w_text[n] ); -#else glyph->index = FT_Get_Char_Index( face, letter ); -#endif /* compute glyph origin */ if ( use_kerning && previous && glyph->index ) { @@ -482,6 +470,8 @@ 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 ); @@ -492,10 +482,7 @@ gfx_string gfx_string_create(FT_Face face,const char *text, string->width = string->bbox.xMax - string->bbox.xMin; } string->height = string->bbox.yMax - string->bbox.yMin; -#ifdef HAVE_MBSTOWSC - free(w_text); -#endif - + return string; } -- 2.30.2