Font questions

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
patlecat
Posts: 27
Joined: Wed Feb 18, 2004 11:19 am
Location: Switzerland

Font questions

Post by patlecat »

Hi ya all

I found no information on how to use and create fonts. Of course I figured out how to create and use them, but not how this really works inside or how to achieve good/better results.
I spent 2 hrs. creating various font files, I have tons of fonts. Most of these resulted in unreadable characters or jaggy ones. So how big should I make a font in pixels and points to make it look good? Should I anti-alias the pic in Photoshop? Should I use JPG or PNG rather then BMP, would it give better results?

I abused the Techdemo to customize it to my project. It really has a lot of what I need in it, it's great work Niko :!: But when I wanted to adjust the dimensions of the rectangle to the font and text used with getDimension (s.below) but got no usable result.

Code: Select all

gui::IGUIFont* myFont(device->getGUIEnvironment()->getFont("..\\..\\media\\fontImpact.bmp"));    
core::dimension2d<int> dimPos(myFont->getDimension(L"Direct3D99.9 fps: 999 polys: 999999"));

core::rect<int> pos(10, dimPos.Height+10, dimPos.Width+10,  size.Height-10);

PS: What the heck is that irrlicht.dat file used for? when i leave it out i see no difference?!
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

The problem with the font is strange, it works for me. How does your font texture look like?

The irrlicht.dat is just a .zip file with additional textures, used by the techdemo.
patlecat
Posts: 27
Joined: Wed Feb 18, 2004 11:19 am
Location: Switzerland

Re: Font questions

Post by patlecat »

patlecat wrote:I spent 2 hrs. creating various font files, I have tons of fonts. Most of these resulted in unreadable characters or jaggy ones. So how big should I make a font in pixels and points to make it look good? Should I anti-alias the pic in Photoshop? Should I use JPG or PNG rather then BMP, would it give better results?
Well Niko?

The problem is not that getDimension gives an odd looking font, but rather seems to have values, which places the text outside of the screen, at least that's what I'm guessing, since I haven't figured out how to debug irrLicht apps and use breakpoints. (besides the Techdemo doesn't compile in debug mode right now).
Post Reply