How to create custom font

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
Ravi08
Posts: 249
Joined: Thu Jul 17, 2008 12:25 pm

How to create custom font

Post by Ravi08 »

Hi, i know questions about the font has been asked quite alot but i couldn't find anything to help me so was hoping someone could point me in the right direction.

I have created my gui elements (button images, background etc) using photoshop elements and i created some nice text effect to make the text look better and fit into my game. Now i know there is the font tool but it can't reproduce what i want. So is there another tool which could help, any advice is welcome.

Thank you.
"Hey Baby Wobbling Wobbling"
-Russell Peters
CuteAlien
Admin
Posts: 9679
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: How to create custom font

Post by CuteAlien »

What is the problem with the font-tool? Afaik bitmap fonts find the sizes of each character by looking for points in certain colors. Take a look at one of the fonts coming with Irrlicht and you can see it pretty easy.
What kind of effect do you try? What isn't possible with current fonts is for example having multicolored characters - you would have to write your own font-implementation for that.
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
Ravi08
Posts: 249
Joined: Thu Jul 17, 2008 12:25 pm

Re: How to create custom font

Post by Ravi08 »

Thank you for your reply and from what you have said i think i would have to implement my own font. What do you mean, create my own font class?

This is an exmaple of the font i want to use, not the best but works for me. :)
Image
"Hey Baby Wobbling Wobbling"
-Russell Peters
CuteAlien
Admin
Posts: 9679
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: How to create custom font

Post by CuteAlien »

Hm, it's all shades of red so it might work. But I'm right now not deep enough into this - I just think you can set a color when font-drawing - so it's probably conflicting with colors which the fonts themself have already. But then again it's just using the usual sprite-drawing functions and I would be surprised if those wouldn't work with multi-color sprites so could be I'm wrong.

But in case it does not work - what I mean is that you then would have to write a class similar to CGUIFont (CGUIFont.cpp/.h). Except that you would have to use drawing functions that support multicolor.
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
Ravi08
Posts: 249
Joined: Thu Jul 17, 2008 12:25 pm

Re: How to create custom font

Post by Ravi08 »

Thank you for the info and il look into it.
"Hey Baby Wobbling Wobbling"
-Russell Peters
Ravi08
Posts: 249
Joined: Thu Jul 17, 2008 12:25 pm

Re: How to create custom font

Post by Ravi08 »

In case someone looks at this topic, my solution was to create the font using the font tool with the correct font and size then go into my image editing software (Photoshop) and then edit the image files with my text, save then load the xml. Might take longer but it worked perfectly.

Also i found this which is an advanced version of the font tool, i would recommend it.
http://irrlicht.sourceforge.net/forum/v ... ol#p219503
"Hey Baby Wobbling Wobbling"
-Russell Peters
Post Reply