Page 1 of 1

Change the text size on static ?

Posted: Tue Jan 22, 2008 10:05 pm
by arfgh
How can i set the size on the static text added to the scene ?

IGUIStaticText * text=guienv->addStaticText(L"", rect<int>(100,28,200,38),false,false,0,-1,false);
texto->setText(blah);

Re: Change the text size on static ?

Posted: Tue Jan 22, 2008 10:17 pm
by Rytz
arfgh wrote:How can i set the size on the static text added to the scene ?

IGUIStaticText * text=guienv->addStaticText(L"", rect<int>(100,28,200,38),false,false,0,-1,false);
texto->setText(blah);
The static text object has nothing to do with what you're asking. You need to change the size of the font. Check the FAQ's and Tutorials or do a forum search for "font size".

Here's a couple threads that I found:
http://irrlicht.sourceforge.net/phpBB2/ ... =font+size
http://irrlicht.sourceforge.net/phpBB2/ ... =font+size

Posted: Wed Jan 23, 2008 2:31 pm
by arfgh
But i am not using any font. Just the default one.
I only need to make it ab it big..

Posted: Wed Jan 23, 2008 2:33 pm
by CuteAlien
You can't - it's a bitmap font. You can scale the bitmap itself and load that as font, then you have a bigger font. Or you can search the forums for ways to include truetype fonts, those can be scaled.

Posted: Wed Jan 23, 2008 3:10 pm
by arfgh
"You can't - it's a bitmap font."

are you talking about the file "fontcourier.bmp" included in the irrlicht ?

"You can scale the bitmap itself and load that as font, then you have a bigger font. Or you can search the forums for ways to include truetype fonts, those can be scaled."


can you show me a simple example to do that ?

Posted: Wed Jan 23, 2008 3:25 pm
by CuteAlien
Truetypefonts are discussed for example here: http://irrlicht.sourceforge.net/phpBB2/ ... sc&start=0

You can create fonts with IGUIEnvironment::getFont. The filename is usually that of a bitmap. To change the font for a single static element you can use IGUIStaticText::setOverrideFont. To change it for certain groups of elements you can use IGUISkin::setFont.

I never created a font myself, but there is a fonttool which can help you doing that.

Posted: Wed Jan 23, 2008 3:41 pm
by arfgh
ok

but can someone explain where is the irrlicht font it uses ?
i mean this so small on it appears when i use the staticText.

Posted: Wed Jan 23, 2008 3:56 pm
by CuteAlien
That font is saved as sourcecode (you can do so with Gimp) and included in the library.

Posted: Wed Jan 23, 2008 4:01 pm
by JP
Just use the font tool, part of the SDK, to make your own bitmap font from a TTF font and load it in yourself.

Posted: Sat May 24, 2008 10:35 pm
by lobo-tuerto
The font tool compiled succesfully in my system (ubuntu 8.04) but when I execute the program, the title bar reads: "Unable to create fonts, your OS is not supported :-("

Do you know why is that?

Posted: Sat May 24, 2008 11:09 pm
by hybrid
Because Linux is not supported :wink:

Posted: Tue Mar 24, 2009 1:18 pm
by asiatin
I have tested the IrrFonttool , its very good and works fine.

and so simple to use.

thanks
asiatin