Fonts problems

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
hilnius
Posts: 33
Joined: Tue Jun 29, 2010 9:55 pm

Fonts problems

Post by hilnius »

Hello,

I have lots of problems with fonts and irrlicht...
I tried to use the CGUITTFont plugin, it load the font but doesn't draw it...
I tried to use Irrlicht Font Maker, but after creating bitmaps Irrlicht tells me "The amount of upper corner pixels and the lower corner pixels is not equal, font file may be corrupted."
With these fonts :
http://www.dafont.com/fr/planet.font
http://www.dafont.com/fr/space-age.font

Can tell me how to load one of these fonts in irrlicht ?

Thanks
Hilnius
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Post by greenya »

Use FontTool.exe to generate font. this tool will produce at least 2 files: xml file and 1+ image files. You should pass path to xml file when loading font using getFont().

Something like this:

Code: Select all

 gui::IGUIEnvironment *irrGUI = irrDevice->getGUIEnvironment();
 gui::IGUIFont* fnt = irrGUI->getFont("myfont.xml");
 irrGUI->getSkin()->setFont(fnt);
hilnius
Posts: 33
Joined: Tue Jun 29, 2010 9:55 pm

Post by hilnius »

"Use FontTool.exe"
and where can i get it ?

if you mind the IrrFontTool inclueded in irrlicht SDK, should i use the "oldFontTool" or the "newFontTool"

Thanks
hilnius
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Post by greenya »

\tools\IrrFontTool\newFontTool produces EXE ../../../bin/Win32-visualstudio/FontTool.exe.
hilnius
Posts: 33
Joined: Tue Jun 29, 2010 9:55 pm

Post by hilnius »

i work on code::blocks :? :? :cry: :cry:
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Post by greenya »

Just download Irrlicht SDK 1.7.1 from ( http://irrlicht.sourceforge.net/downloads.html ). It contains compiled FontTool.exe in bin folder.
hilnius
Posts: 33
Joined: Tue Jun 29, 2010 9:55 pm

Post by hilnius »

it works... but the font is really... ugly...

EDIT : i used the font tool x32... i gonna try with the x64 version when i'll have time to compile it... if it's a windows bug please tell me

Thanks for all help you had given to me
hilnius
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Post by greenya »

Please post sceenshot along with short code sample to show what you do and what you get.

P.S.: when enabling anti aliasing and saving font in PNG format, font looks quite good for me.
hilnius
Posts: 33
Joined: Tue Jun 29, 2010 9:55 pm

Post by hilnius »

i cannot build it for x64... so i post this screen of the font that FontTool creates for me :
Image
as you can see, the bitmap isn't really beautiful..

How do you active anti-aliasing ? (i'm on windows seven x64)
Please understand that i'm french, that's why my english is imperfect...
Luben
Posts: 568
Joined: Sun Oct 09, 2005 10:12 am
Location: #irrlicht @freenode

Post by Luben »

Have you tried any of the other font tools that circulate on the forums?
hilnius
Posts: 33
Joined: Tue Jun 29, 2010 9:55 pm

Post by hilnius »

i just understand that the button 'AA' activates anti-aliasing...

anyway, Irrlicht Font Maker creates a largely better font than FontTool, but corrupted fonts -_-
Please understand that i'm french, that's why my english is imperfect...
Luben
Posts: 568
Joined: Sun Oct 09, 2005 10:12 am
Location: #irrlicht @freenode

Post by Luben »

hilnius
Posts: 33
Joined: Tue Jun 29, 2010 9:55 pm

Post by hilnius »

wow...
amazing

thanks, it solved my problem.
Please understand that i'm french, that's why my english is imperfect...
Triadian
Posts: 6
Joined: Wed May 22, 2013 12:53 am

Re: Fonts problems

Post by Triadian »

Firstly, Sorry for the necro.

Secondly, i came across this very same problem and the other font program linked 2 posts up didn't like my font for some reason so that wasnt a solution for me, however i found the problem which worked for me. the font i used put pixels in the lines where the red/yellow red/blue pixels are which skews the results and gives bad font sizes etc and the above error about non matching upper and lower numbers.

TLDR - SOLUTION
remove all the white/grey pixels on the horizontal lines where you have the coloured pixels.
Post Reply