From: Mikko Rasa Date: Fri, 23 Nov 2012 20:29:11 +0000 (+0200) Subject: Minor cleanup X-Git-Tag: 1.0~3 X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=4e23e9715dbd92cc53c085e465c4df2e704df3c1;p=ttf2png.git Minor cleanup --- diff --git a/ttf2png.c b/ttf2png.c index 7ef19e1..e254349 100644 --- a/ttf2png.c +++ b/ttf2png.c @@ -61,8 +61,8 @@ typedef struct sFont Image image; } Font; -unsigned round_to_pot(unsigned); void usage(); +unsigned round_to_pot(unsigned); void *alloc_image_data(size_t, size_t); int init_font(Font *, FT_Face, unsigned, unsigned, int); int render_grid(Font *, unsigned, unsigned, unsigned, int); @@ -271,18 +271,6 @@ int main(int argc, char **argv) return 0; } -unsigned round_to_pot(unsigned n) -{ - n -= 1; - n |= n>>1; - n |= n>>2; - n |= n>>4; - n |= n>>8; - n |= n>>16; - - return n+1; -} - void usage() { printf("ttf2png - True Type Font to PNG converter\n" @@ -307,6 +295,18 @@ void usage() " -h Print this message\n"); } +unsigned round_to_pot(unsigned n) +{ + n -= 1; + n |= n>>1; + n |= n>>2; + n |= n>>4; + n |= n>>8; + n |= n>>16; + + return n+1; +} + void *alloc_image_data(size_t a, size_t b) { void *ptr; @@ -396,7 +396,7 @@ int init_font(Font *font, FT_Face face, unsigned first, unsigned last, int autoh /* Copy the glyph image since FreeType uses a global buffer, which would be overwritten by the next glyph. Negative pitch means the scanlines - start from the bottom */ + start from the bottom. */ if(bmp->pitch<0) { for(y=0; yrows; ++y) for(x=0; xwidth; ++x)