X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=ttf2png.c;h=8fc211e4900fd73b6f41711075a6162de8034663;hb=4709d1e1e7da55da3215746fc07cffc6b6fe3c00;hp=e25434945e41fa44d906ebfd1c5babc431b791a3;hpb=4e23e9715dbd92cc53c085e465c4df2e704df3c1;p=ttf2png.git diff --git a/ttf2png.c b/ttf2png.c index e254349..8fc211e 100644 --- a/ttf2png.c +++ b/ttf2png.c @@ -273,7 +273,7 @@ int main(int argc, char **argv) void usage() { - printf("ttf2png - True Type Font to PNG converter\n" + printf("ttf2png 1.0 - True Type Font to PNG converter\n" "Copyright (c) 2004-2008 Mikko Rasa, Mikkosoft Productions\n" "Distributed under the GNU General Public License\n\n"); @@ -320,14 +320,14 @@ void *alloc_image_data(size_t a, size_t b) a += c; if(aglyphs[font->n_glyphs-1].code; font->image.w = round_to_pot(cpl*cellw); - font->image.h = round_to_pot((last-first+cpl)/cpl*cellh); + if(seq) + font->image.h = round_to_pot((font->n_glyphs+cpl-1)/cpl*cellh); + else + font->image.h = round_to_pot((last-first+cpl)/cpl*cellh); font->image.data = (char *)alloc_image_data(font->image.w, font->image.h); if(!font->image.data) @@ -727,7 +730,7 @@ int save_png(const char *fn, const Image *image, char alpha) png_info *pngi; png_byte **rows; unsigned i; - png_byte *data2; + png_byte *data2 = 0; int color; if(!strcmp(fn, "-"))