Handling of internationalization in CGUIFont

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
MartinVee
Posts: 139
Joined: Tue Aug 02, 2016 3:38 pm
Location: Québec, Canada

Handling of internationalization in CGUIFont

Post by MartinVee »

I used Irrlicht Font Maker to generate a PNG image of a font (Lucida Handwriting, if it's important). I loaded the PNG with a CGUIFont and I drew the string "Iñtërnâtiônàlizætiøn". All those characters are on the PNG.

It outputs "Iñòtëìrnâãtiôõnàálizæçtiøùn".

There's a few extra characters here. I looked at the code, and I can't understand why it's happening.

Where does the problem come from? Is CGUIFont capable of handling this kind of string? Does Irrlicht Font Maker produce incorrect character sheets?
Rayshader
Posts: 21
Joined: Tue Mar 28, 2017 1:18 pm

Re: Handling of internationalization in CGUIFont

Post by Rayshader »

Hi,
You wrote CGUIFont, it isn't IGUIFont ? (Cannot find CGUIFont in the API documentation...)
I've tested your string "Iñtërnâtiônàlizætiøn" with the default font :

Code: Select all

 
env->getBuiltInFont();
 
And the output is correct.
Could you show the generated PNG you load ?
MartinVee
Posts: 139
Joined: Tue Aug 02, 2016 3:38 pm
Location: Québec, Canada

Re: Handling of internationalization in CGUIFont

Post by MartinVee »

No problem! I don't think there's copyright issues with Lucida anyway.

Image

EDIT :
What I actually meant is that I check the implementation of the IGUIFont. That's why I talked about CGUIFont. But you're right ; what I'm really doing is :

Code: Select all

 
IGUIFont font * = env->getFont(filename);
 
MartinVee
Posts: 139
Joined: Tue Aug 02, 2016 3:38 pm
Location: Québec, Canada

Re: Handling of internationalization in CGUIFont

Post by MartinVee »

Oh! I just realized that I had a message in the log :

Code: Select all

 
The amount of upper corner pixels and the lower corner pixels is not equal, font file may be corrupted.
 
So, there maybe a problem with either Lucide Handwriting, or Irrlicht Font Maker. I'm trying a more common font.
MartinVee
Posts: 139
Joined: Tue Aug 02, 2016 3:38 pm
Location: Québec, Canada

Re: Handling of internationalization in CGUIFont

Post by MartinVee »

Oh, I tried with Segoe UI, and it worked! What the...?

EDIT :

Okay, I tried Nikolay Atanassov's Very Advanced irrFontTool, and when I try to load "Lucida Handwriting", I get the folowing warning :

Code: Select all

 
Could not get lower surface level for mip map generation
 
And the tool refuses to generate a font PNG. Irrlicht Font Maker didn't complain.

So it seems that the problem came from Lucida Handwriting.

Thanks a lot!
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Handling of internationalization in CGUIFont

Post by CuteAlien »

Hm, irrlicht font tool shouldn't really produce invalid fonts I guess. On which operating system did you use it (it's implemented slightly different for Windows&Linux).
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
MartinVee
Posts: 139
Joined: Tue Aug 02, 2016 3:38 pm
Location: Québec, Canada

Re: Handling of internationalization in CGUIFont

Post by MartinVee »

On Windows 10. I used Irrlicht Font Maker. I generated a font using Lucida Handwriting, with a map of 512x512 and a font size of 10.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Handling of internationalization in CGUIFont

Post by CuteAlien »

Thanks (Irrlicht also comes with a fontmaker tool, so I thought it was about that one).
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