Font

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
spannerman
Home away from home
Home away from home
Posts: 330
Joined: Wed Jan 12, 2005 12:06

Font

Postby spannerman » Wed Nov 03, 2004 23:21

Not sure I understand your problem there (do you have errors in your CEGUI log?) but you can specify multiple fonts in code and use them when you like. For example, to create a CEGUI font called mySmallFont based on the Tahoma true type font that comes with the CEGUI samples:

Code: Select all

CEGUI::Font* smallfont = CEGUI::FontManager::getSingleton().createFont("mySmallFont", "/fonts/tahoma.ttf", 10, 0);
smallfont->setAutoScalingEnabled(true);
smallfont->setNativeResolution(Size(800, 600));


You can then set this font as the default font like this:

Code: Select all

System::getSingleton().setDefaultFont("mySmallFont");


Or just set individual widgets to use this font:

Code: Select all

myWidget->setFont("mySmallFont");


Hope that helps, sorry if I didnt understand your question.

User avatar
Emmeran
Quite a regular
Quite a regular
Posts: 46
Joined: Wed Jan 12, 2005 12:06
Location: Germany, near Nuremberg
Contact:

Font

Postby Emmeran » Thu Nov 04, 2004 23:28

please post your log when nothing's shown

User avatar
Emmeran
Quite a regular
Quite a regular
Posts: 46
Joined: Wed Jan 12, 2005 12:06
Location: Germany, near Nuremberg
Contact:

Font

Postby Emmeran » Fri Nov 05, 2004 16:52

ok. of course u have to create the font tahoma-12 if it's used.
you can do this with the scheme or with this code:

Code: Select all

CEGUI::Font* myFont = CEGUI::FontManager::getSingleton().createFont("Tahoma-12", "/fonts/tahoma.ttf", 12, 0);
myFont->setAutoScalingEnabled(true);
myFont->setNativeResolution(Size(800, 600));


And you can change the font of each window whenever u like with the setFont() command

User avatar
Emmeran
Quite a regular
Quite a regular
Posts: 46
Joined: Wed Jan 12, 2005 12:06
Location: Germany, near Nuremberg
Contact:

Font

Postby Emmeran » Fri Nov 05, 2004 18:57

:D no matter


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 4 guests