summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a34d690)
raw | patch | inline | side by side (parent: a34d690)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sun, 22 May 2005 22:29:11 +0000 (22:29 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sun, 22 May 2005 22:29:11 +0000 (22:29 +0000) |
program/src/rrd_gfx.c | patch | blob | history |
diff --git a/program/src/rrd_gfx.c b/program/src/rrd_gfx.c
index ac33ba208ad9681afe4806d38b6e8cc37bc2ca17..0de62aa5edaafede770b37600cee55ddc1e052be 100644 (file)
--- a/program/src/rrd_gfx.c
+++ b/program/src/rrd_gfx.c
struct gfx_string_s {
unsigned int width;
unsigned int height;
- size_t count; /* number of characters */
+ int count; /* number of characters */
gfx_char glyphs;
size_t num_glyphs;
FT_BBox bbox;
@@ -376,7 +376,7 @@ gfx_string gfx_string_create(gfx_canvas_t *canvas, FT_Face face,const char *text
gfx_string string = (gfx_string) malloc (sizeof(struct gfx_string_s));
gfx_char glyph; /* current glyph in table */
- unsigned int n;
+ int n;
int error;
int gottab = 0;
@@ -409,7 +409,7 @@ gfx_string gfx_string_create(gfx_canvas_t *canvas, FT_Face face,const char *text
use_kerning = FT_HAS_KERNING(face);
previous = 0;
glyph = string->glyphs;
- for (n=0; n<string->count;glyph++) {
+ for (n=0; n<string->count;glyph++,n++) {
FT_Vector vec;
/* handle the tabs ...
have a witespace glyph inserted, but set its width such that the distance
@@ -456,7 +456,7 @@ gfx_string gfx_string_create(gfx_canvas_t *canvas, FT_Face face,const char *text
}
error = FT_Get_Glyph (slot, &glyph->image);
if (error) {
- fprintf (stderr, "couldn't get glyph from slot: %c\n", letter);
+ fprintf (stderr, "couldn't get glyph %d 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\n");
+ fprintf (stderr, "couldn't transform glyph id %d\n", letter);
continue;
}
@@ -488,15 +488,13 @@ 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 to bitmap\n");
+ fprintf (stderr, "couldn't convert glyph id %d to bitmap\n", letter);
continue;
}
/* increment number of glyphs */
previous = glyph->index;
string->num_glyphs++;
- n++;
-
}
free(cstr);
/* printf ("number of glyphs = %d\n", string->num_glyphs);*/