Scaling of bitmap fonts

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

Sairon
Not too shy to talk
Not too shy to talk
Posts: 22
Joined: Sun Dec 07, 2008 01:11

Scaling of bitmap fonts

Postby Sairon » Tue Dec 15, 2009 20:34

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.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Scaling of bitmap fonts

Postby CrazyEddie » Wed Dec 16, 2009 09:59

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.

Sairon
Not too shy to talk
Not too shy to talk
Posts: 22
Joined: Sun Dec 07, 2008 01:11

Re: Scaling of bitmap fonts

Postby Sairon » Wed Dec 16, 2009 13:54

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

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Scaling of bitmap fonts

Postby CrazyEddie » Wed Dec 16, 2009 14:35

Great stuff :mrgreen:


Return to “Help”

Who is online

Users browsing this forum: No registered users and 8 guests