changing the size of the font

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

jchmack
Just popping in
Just popping in
Posts: 12
Joined: Tue Mar 27, 2007 15:13

changing the size of the font

Postby jchmack » Fri Jul 13, 2007 18:59

I am trying to change the size of the text displayed in a listbox. I am using the basic taharez scheme. Is there a way i can change the size of this text?

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Postby Rackle » Fri Jul 13, 2007 20:53

Maybe (yes, that's a big maybe) changing the "Font" property of the ListboxItem, from which is derived ListboxTextItem, is what you're after. Each "font" refers to font name, size, and style.

You'll probably also have to call upon the ListboxItem's handleUpdatedItemData() function to update the listbox item.

Another approach would be to read through Levia's Create a CheckListboxItem tutorial. That way you may have greater control over the attributes you need, such as the font size.
Last edited by Rackle on Fri Jul 13, 2007 20:59, edited 1 time in total.

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Postby scriptkid » Fri Jul 13, 2007 20:58

Hi, assuming that you are using the latest CEGUI version, the taharez.scheme contains a line with the default font being used:

<Font Name="Commonwealth-10" Filename="Commonwealth-10.font" />

I just see that Rackle has replied, changing the Font of your listbox should be enough. You can make a font-file of your own as well, just open on of the existing ones for a sample. Their format is easy.

And as Rackle suggests, you can change the font with a line line this:
<Property Name="Font" Value="MyFont" /> --layout
setProperty("Font", "MyFont") -- code

Note that the property value is the font's name, not the filename! The name is defined in an xml tag in your .font file.

Good luck! :)

jchmack
Just popping in
Just popping in
Posts: 12
Joined: Tue Mar 27, 2007 15:13

Postby jchmack » Fri Jul 13, 2007 23:16

Thank you for the quick replies guys. So i am assuming there is no way to scale up/down one font? I would have to make a font for each size and change it in CEGUI. As easy as it is to make another font it would be increasingly difficult to have many different fonts for different resolutions. So in all i will have f= NumberOfFonts * NumberOfFontSizes. Hopefully i wont have too many fonts which i dont see the need for many.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 13 guests