X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=ttf2png.c;h=f8f465ffd6bf80209032a66475069fe5728c9f44;hb=2f8c54a609d778b2f4808f54d4c07b30acccb5a9;hp=a9896c39f9e2c737d0f7d1576199f8a0fee0239c;hpb=e13494aae1ab762e1b799571c7971cfe0a730451;p=ttf2png.git diff --git a/ttf2png.c b/ttf2png.c index a9896c3..f8f465f 100644 --- a/ttf2png.c +++ b/ttf2png.c @@ -351,7 +351,7 @@ int init_font(Font *font, FT_Face face, unsigned first, unsigned last, int autoh { unsigned n; FT_Bitmap *bmp = &face->glyph->bitmap; - int x, y; + unsigned x, y; int flags = 0; Glyph *glyph; @@ -511,7 +511,10 @@ int render_grid(Font *font, unsigned cellw, unsigned cellh, unsigned cpl, int se last = font->glyphs[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)