changing the size of the font
Moderators: CEGUI MVP, CEGUI Team
changing the size of the font
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?
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.
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.
- scriptkid
- Home away from home
- Posts: 1178
- Joined: Wed Jan 12, 2005 12:06
- Location: The Hague, The Netherlands
- Contact:
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!
<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!
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.
Who is online
Users browsing this forum: No registered users and 13 guests