Possible Font bug ???

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
Xandar
Posts: 16
Joined: Mon Nov 28, 2005 9:17 pm
Contact:

Possible Font bug ???

Post by Xandar »

I can't load the new fonts created using new IrrFontTool. When i try to load it it returns me an error message:

"The amount of upper corner pixels or lower corner pixels is == 0, font file may be corrupted."

I am using this font:

Image

I also noticed that the font images created using old IrrFontTool have some red pixels, or something like that in the corners.

Old font:

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

Post by greenya »

show the code you using to load the font.

before you doing this -- check what file do you trying to load, you should load XML file not a graphic image file format.
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

That first font won't load, it needs the proper upper and lower pixel indicators( notice they are in the second font ). Just use the old font tool for now.
Image
Xandar
Posts: 16
Joined: Mon Nov 28, 2005 9:17 pm
Contact:

Post by Xandar »

show the code you using to load the font.
I'm not stupid. I know how to load font. :D

Code: Select all

pSkin = pIrrGUI->getSkin();
pFont = pIrrGUI->getFont("font.png");
if(pFont)
        pSkin->setFont(pFont);
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Post by greenya »

ok ok,

i thought you trying using 1.3 fonts ... 1.3 version just released ... so i was thinking of ... :)

p.s.: besides xml-fonts very tasty ... antialiasing ... very nice looking.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I think the new tool cannot generate the old font files. So use the new method for loading here, too.
AlexL
Posts: 184
Joined: Tue Mar 02, 2004 6:06 pm
Location: Washington State

Post by AlexL »

The new loading method of fonts, is that not the following?

Code: Select all

irr::gui::IGUIFont* pFont = pGui->getFont("..\\datas\\comicsans_12px.xml");
	if(pFont != NULL)
		pSkin->setFont(pFont);
If the above is correct, then I am having a problem with the font being successfully loaded. The font xml file, is not a vector font, and the generated font png file is in the same directory as the xml. Is this a bug, or not fully added feature; or just user error as with most of my problems?
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

it's a bug, sorry about that.. currently the image files are loaded relative to the current dir, so you'll have to edit the xml file and put the same path in.
for example- "../datas/comicsans_12px.png"
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
jeffm2501
Posts: 9
Joined: Sat Sep 23, 2006 4:07 pm
Location: California, US
Contact:

Post by jeffm2501 »

I've made a patch that uses the image paths in the XML relative to the XML file itself.

http://sourceforge.net/tracker/index.ph ... tid=540678
JeffM2501
Post Reply