]> git.tdb.fi Git - ttf2png.git/blobdiff - ttf2png.c
Avoid warning about signed/unsigend mismatch
[ttf2png.git] / ttf2png.c
index 9714ecd24a32ee95b99f009a6ea29d7d2cb9d38a..f8f465ffd6bf80209032a66475069fe5728c9f44 100644 (file)
--- 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");
 
@@ -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)