Euro sign in Irrlicht

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Donald Duck
Posts: 34
Joined: Sat Jan 21, 2017 6:51 pm
Location: Duckburg
Contact:

Euro sign in Irrlicht

Post by Donald Duck »

I would like to use the Euro sign (€) in a GUI text box in Irrlicht. Here is my code:

Code: Select all

#define IRRLICHTPATH "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Libraries\\irrlicht-1.8.4\\"
irr::gui::IGUIEnvironment *gui = device->getGUIEnvironment();
irr::gui::IGUIFont *font = gui->getFont(IRRLICHTPATH"media\\fontlucida.png");
gui->getSkin()->setFont(font);
irr::gui::IGUIStaticText *text = gui->addStaticText(L"", irr::core::rect<irr::s32>(100, 60, 400, 160), true, true, 0, -1, true);
while(device->run()){
    driver->beginScene(true, true, irr::video::SColor(255, 255, 255, 255));
    sceneManager->drawAll();
    text->setText(L"€");
    gui->drawAll();
    driver->endScene();
}
The problem is that I get the following output:

Image

How can I use the Euro sign in Irrlicht?
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Euro sign in Irrlicht

Post by CuteAlien »

Hm, you probably have to use another font - that one doesn't seem to have an € character.
You can use the font-tool to create new bitmap fonts.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Donald Duck
Posts: 34
Joined: Sat Jan 21, 2017 6:51 pm
Location: Duckburg
Contact:

Re: Euro sign in Irrlicht

Post by Donald Duck »

Thanks. I used the font tool to create my own fonts and it worked.

I found the font tool here: http://irrlicht.sourceforge.net/forum// ... hp?t=37735

It can be downloaded here: http://www.files.com/shared/58a971b5e7230/FontTool.zip

I've created a font that supports the Euro sign (and probably many other special characters too) that can be downloaded here: http://www.files.com/shared/58a975c6a1167/calibri.zip
To use it, use the following code:

Code: Select all

gui->getFont("calibri.xml");
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Euro sign in Irrlicht

Post by CuteAlien »

There is also one in Irrlicht which you can also build it yourself (not the same one you found). It is in tools/IrrFontTool folder.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply