Page 1 of 1

Scaling of bitmap fonts

Posted: Tue Dec 15, 2009 20:34
by Sairon
I'm wondering if there's a way to apply scaling for bitmap fonts. We have a high res bitmap font and would like to down sample for lower sizes of the same font, both to save texture space, but first and foremost to save time.

Re: Scaling of bitmap fonts

Posted: Wed Dec 16, 2009 09:59
by CrazyEddie
Hi,

Well, in theory it's possible because the font member functions have a 'scale' argument, however in practice this is not exposed in the upper layers of the system :?

If it were possible to share the bitmap imageset between fonts (which it might be in 0.7.x, though if it does work you need to be very, very careful), you may be able to achieve a desired result via manipulation of the font native resolution. Note that this is very hairy stuff indeed; it's not something I've ever tried, so it may not work at all, but it might be worth a try :)

CE.

Re: Scaling of bitmap fonts

Posted: Wed Dec 16, 2009 13:54
by Sairon
It was rather easy to implement by looking at all the instances where auto scaling was used for fonts, just slapped a scaling factor right on and exposed it to the xml handler. Seems to work nicely :D

Re: Scaling of bitmap fonts

Posted: Wed Dec 16, 2009 14:35
by CrazyEddie
Great stuff :mrgreen: