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);
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"
" -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;
/* 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; y<bmp->rows; ++y) for(x=0; x<bmp->width; ++x)