Unicode and the Linux FontTool.

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
disanti
Posts: 367
Joined: Sat Jan 17, 2004 1:36 am
Location: California, US
Contact:

Unicode and the Linux FontTool.

Post by disanti »

Hello,

I just created a font using the new Linux FontTool (I haven't used Irrlicht for a couple of years, just checking it out again). I must say, I'm very impressed with the new Linux support for font creation. However, I'm seeing one potential problem.

On Linux, wchar_t is 4 bytes long while on Windows, it is only 2 bytes. Thus, the font XML file is essentially being saved in UTF-32 when created by the Linux FontTool, while it is likely saved in UTF-16 on Windows (I'm guessing on that one, I don't actually have Windows to try that with).

So my question is, when I do port whatever I write with Irrlicht to Windows, will it be able to load my font XML files without any encoding changes? Is IrrXML intelligent enough to determine that the files are UTF-32 or UTF-16?

Oh, and a little off topic, but could the next Irrlicht release not have the documentation packaged in a CHM file? That is extremely inconvenient for Linux users.

Thanks!
________
Hawaii dispensary
Last edited by disanti on Sun Feb 27, 2011 11:12 pm, edited 1 time in total.
CuteAlien
Admin
Posts: 9670
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Unicode and the Linux FontTool.

Post by CuteAlien »

disanti wrote: So my question is, when I do port whatever I write with Irrlicht to Windows, will it be able to load my font XML files without any encoding changes? Is IrrXML intelligent enough to determine that the files are UTF-32 or UTF-16?
Yes, it is intelligent enough to do that (though there is still a reported bug for 64-bit systems open).
disanti wrote: Oh, and a little off topic, but could the next Irrlicht release not have the documentation packaged in a CHM file? That is extremely inconvenient for Linux users.
To create the html-documentation locally you can run scripts/doc/irrlicht/makedocumentation.sh
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
disanti
Posts: 367
Joined: Sat Jan 17, 2004 1:36 am
Location: California, US
Contact:

Post by disanti »

Perfect, thanks! :)
Last edited by disanti on Sun Feb 27, 2011 11:12 pm, edited 1 time in total.
Cloudef
Posts: 123
Joined: Wed Dec 03, 2008 9:02 pm
Location: Finland

Post by Cloudef »

Also if you have sometimes problems opening the XML files under linux, because they are UTF-32 (sometimes incorrectly written) you might wanna try this. It just converts to UTF-8, but i had unexpected behavioir in one of my projects and gEdit would not open the XML files (There was binary on the file).
Thanks to CuteAlien for the script.

#!/bin/sh

if test $# = 0
then
echo usage: utf32to8 source [target]
exit 1
fi
if iconv -f UTF-32 -t UTF-8 $1 > .utf32to8dummy
then
mv .utf32to8dummy ${2:-$1}
rm -f .utf32to8dummy
fi
Post Reply