Font size + Ogre explained?

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

User avatar
sjcomp
Not too shy to talk
Not too shy to talk
Posts: 30
Joined: Wed Apr 27, 2005 14:59
Contact:

Font size + Ogre explained?

Postby sjcomp » Mon Apr 28, 2008 01:42

Hello,

I'm using Ogre as the graphics engine. Ogre has overlays which can show fonts. I can use the same true font for CEGUI. But do they use the same generated texture or they are separate?

Now I'd like to change the size of the font, which looks like I'd need to create another .font file which has a different font size. The question is how many font textures will I have now?

If I want to have a fixed width font, I simply can use a fixed width ttf (such as Courier New)?

Thank you.

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 » Mon Apr 28, 2008 07:21

Hi,

Ogre and CEGUI will create their own texture, since both simply don't know about each other in that area.

And indeed, another font size means another representation hence more memory consumption. You might -at code level- fine grain the loading and destroying of fonts when they are (not) needed (anymore).

I think that -since a fixed width font is also a ttf- you can just use that like any other font.

HTH.
Check out my released snake game using Cegui!

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

Re: Font size + Ogre explained?

Postby Rackle » Mon Apr 28, 2008 12:33

sjcomp wrote:Now I'd like to change the size of the font, which looks like I'd need to create another .font file which has a different font size.


You should have a look at these:
http://www.cegui.org.uk/wiki/index.php/GameChatBox
http://www.cegui.org.uk/wiki/index.php/DynamicFont

User avatar
sjcomp
Not too shy to talk
Not too shy to talk
Posts: 30
Joined: Wed Apr 27, 2005 14:59
Contact:

Postby sjcomp » Mon Apr 28, 2008 13:53

Thanks scriptkid and Rackle!
scriptkid wrote:Hi,
Ogre and CEGUI will create their own texture, since both simply don't know about each other in that area.

I see, I thought that given that there is a CEGUIRenderer in ogre it also handles fonts. But if I use a texture for an imageset and the same texture for an overlay, would it be loaded twice?


I see, my understanding is that using this cod for dynamic font results in the same memory consumption as if I'd use font file. If I only need two font sizes, both of which are constantly used in the menu then there is no real need to use dynamic fonts, as they will not save memory for me.

I see that font textures are defined with 800x600, but these are not power of two textures. I think modern cards do not care, but older ones do so they will use 1024x1024 instead. Why 800x600?

Thank you.
Regards, Alexander. http://sjcomp.com

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

Postby Rackle » Mon Apr 28, 2008 14:35

My contribution was more to the effect of "you do not absolutely have to create the .font files but instead can use code". For each _new font_, which is either a .font file or created dynamically, will increase the memory consumption.

User avatar
sjcomp
Not too shy to talk
Not too shy to talk
Posts: 30
Joined: Wed Apr 27, 2005 14:59
Contact:

Postby sjcomp » Mon Apr 28, 2008 15:36

Rackle wrote:My contribution was more to the effect of "you do not absolutely have to create the .font files but instead can use code". For each _new font_, which is either a .font file or created dynamically, will increase the memory consumption.
Got it! Thanks a lot.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 7 guests