From 4e23e9715dbd92cc53c085e465c4df2e704df3c1 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 23 Nov 2012 22:29:11 +0200 Subject: [PATCH] Minor cleanup --- ttf2png.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) 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) -- 2.43.0