Font size at run time

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
ritz
Quite a regular
Quite a regular
Posts: 49
Joined: Wed Jan 12, 2005 12:06

Font size at run time

Postby ritz » Fri May 13, 2005 12:33

Hello All,

I am facing the following issue in using the fonts.

I have loaded default font "arial" in my widget. by default size is 12.

I want to change it's size to 10 at run time.

I am not able to find any method for this.

The only way i could get is use createFont method again to create a different font.

But i need the ttf file name for using this method, which i will not get from my font object.

Can any body suggest me some other method for changing font sizes on run time.

Thanks and Regards,
Ritu

User avatar
_mental_
CEGUI Team (Retired)
Posts: 157
Joined: Wed Jan 12, 2005 12:06
Contact:

Re: Font size at run time

Postby _mental_ » Sat May 14, 2005 23:59

The best thing to do is to create an arial-12.font file and have something in there like this:

<?xml version="1.0" ?>
<Font Name="Arial-12" Filename="arial.ttf" Type="Dynamic" Size="12" NativeHorzRes="800" NativeVertRes="600" AutoScaled="true"/>

You can then load the new XML font definition as normal.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: Bing [Bot] and 4 guests