]> git.tdb.fi Git - ttf2png.git/blobdiff - ttf2png.c
Add the -b option to help text
[ttf2png.git] / ttf2png.c
index f8db322032d725f88b646b329b7cf42753c44fc4..0c1c09a490f0dd675c000496b2f7fd3cc6159e5c 100644 (file)
--- a/ttf2png.c
+++ b/ttf2png.c
@@ -68,7 +68,7 @@ typedef struct sRange
        unsigned last;
 } Range;
 
-typedef int bool;
+typedef unsigned char bool;
 
 void usage(void);
 int convert_numeric_option(char, int);
@@ -309,8 +309,9 @@ void usage(void)
                "  -p  Pack the glyphs tightly instead of in a grid\n"
                "  -m  Margin around image edges (packed mode only) [0]\n"
                "  -n  Padding between glyphs (packed mode only) [1]\n"
-               "  -g  Allow non-power-of-two result\n"
-               "  -f  Create a distance field texture\n"
+               "  -g  Allow non-power-of-two result\n");
+       printf("  -f  Create a distance field texture\n"
+               "  -b  Specify distance field border zone width\n"
                "  -d  File name for writing glyph definitions\n"
                "  -h  Print this message\n");
 }
@@ -878,7 +879,7 @@ int render_packed(Font *font, unsigned margin, unsigned padding)
 {
        unsigned i;
        size_t area = 0;
-       char *used_glyphs;
+       bool *used_glyphs;
        unsigned *used_pixels;
        unsigned cx = margin, cy;
        unsigned used_h = 0;
@@ -917,7 +918,7 @@ int render_packed(Font *font, unsigned margin, unsigned padding)
        memset(font->image.data, 0, font->image.w*font->image.h);
        used_pixels = (unsigned *)malloc(font->image.w*sizeof(unsigned));
        memset(used_pixels, 0, font->image.w*sizeof(unsigned));
-       used_glyphs = (char *)malloc(font->n_glyphs);
+       used_glyphs = (bool *)malloc(font->n_glyphs);
        memset(used_glyphs, 0, font->n_glyphs);
 
        for(cy=margin; cy+margin<font->image.h;)