area = a;
}
- /* Find an image size that's no higher than wide, allowing for some
- imperfections in the packing. */
+ /* Find an image size that's approximately square. */
for(font->image.w=1;; font->image.w<<=1)
{
if(font->image.w<=margin*2)
continue;
- font->image.h = (area*5/4)/(font->image.w-margin*2)+margin*2;
+ font->image.h = area/(font->image.w-margin*2)+margin*2;
if(font->image.h<=font->image.w)
break;
}
- if(!npot)
- font->image.h = round_to_pot(font->image.h);
+
+ /* Add some extra space to accommodate packing imperfections. */
+ font->image.h = font->image.h*3/2;
/* Allocate arrays for storing the image and keeping track of used pixels and
glyphs. Since glyphs are rectangular and the image is filled starting from