- Timestamp:
- Jan 12, 2005, 1:33:03 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pwntcha/trunk/src/font.c
r448 r451 72 72 font->glyphs = malloc(font->size * sizeof(struct glyph)); 73 73 74 for(x = 0, i = 0, xmin = 0; x < font->img->width && i < font->size; x++)74 for(x = 0, i = 0, xmin = 0; x <= font->img->width && i < font->size; x++) 75 75 { 76 76 int found = 0; 77 for(y = 0; y < font->img->height; y++) 78 { 79 getpixel(font->img, x, y, &r, &g, &b); 80 if(r < 128) 77 if(x != font->img->width) 78 for(y = 0; y < font->img->height; y++) 81 79 { 82 found = 1; 83 count += (255 - r); 80 getpixel(font->img, x, y, &r, &g, &b); 81 if(r < 240) 82 { 83 found = 1; 84 count += (255 - r); 85 } 84 86 } 85 } 87 else 88 found = 0; 89 86 90 if(found && !incell) 87 91 { … … 103 107 { 104 108 getpixel(font->img, newx, y, &r, &g, &b); 105 if(r < 128)109 if(r < 240) 106 110 { 107 111 gotit = 1; … … 132 136 if(i != font->size) 133 137 { 134 printf("%s: could not find %i glyphs in font\n", argv0, font->size); 138 fprintf(stderr, "%s: could only find %i of %i glyphs in font %s\n", 139 argv0, i, font->size, file); 135 140 image_free(font->img); 136 141 free(font->glyphs);
Note: See TracChangeset
for help on using the changeset viewer.