Page 1 of 1

Add special chars to the GUI...

Posted: 10 Jan 2007, 17:54
by KaTSuo
Hi

Here is my first modification of the TMW source.
It fixes the special chars bugs... When you tried to add chars like "é", "à", ... to your NPC dialogs, it was replaced by a square...

Here is the sansserif8.png file
Image

And the snippet... In gui/source/gui.cpp (arround l.120) :

Code: Select all

mGuiFont = new gcn::ImageFont("graphics/gui/sansserif8.png",
                " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ["
                "\\]^_`abcdefghijklmnopqrstuvwxyz{|}~|"
                "áÃ

Posted: 10 Jan 2007, 18:07
by Crush
When you already started with adding support for some special characters how about doing it seriously and add the rest of the ISO-Latin-9 character set, too?
http://en.wikipedia.org/wiki/ISO/IEC_8859-15
(without the control codes, of course)

This should cover all common languages that use a variant of the latin alphabet.

Posted: 11 Jan 2007, 10:13
by Rotonen
On the long run we should just go for UTF-8, though. We will no doubt have asian players too on the long run.

Posted: 11 Jan 2007, 16:20
by Crush
You mean implementing the whole unicode character set? Rotonen, do you know how many characters are included in it? Tens of thousands!

Posted: 11 Jan 2007, 17:04
by Matt
Crush wrote:You mean implementing the whole unicode character set? Rotonen, do you know how many characters are included in it? Tens of thousands!
You should start working then ;D

Posted: 11 Jan 2007, 17:51
by Rotonen
We're planning on using TTF for fonts in the future so UTF-8 would be the best choice, right?

Re:

Posted: 14 Jun 2008, 09:27
by xmlie
Crush wrote:You mean implementing the whole unicode character set? Rotonen, do you know how many characters are included in it? Tens of thousands!
Well ,Unfortunately,i'm one of the ten of thousands.
And sorry for my English ,i'm from China.
It's not esay to make SDL support unicode character .
However i still waiting for the multi-language edition.
Is that possible?

Re: Add special chars to the GUI...

Posted: 14 Jun 2008, 16:30
by fate
Hi,

CJK support requires more than just output font support. Apparently there is a CJK input patch (that falls back to XIM and some Win32 input method I haven't heard of) for libsdl floating around at

http://sdl-im.csie.net/

that might do the trick, but I'm not sure if it requires client-side support. Tuxpaint (http://www.tuxpaint.org/) has some foreign language input support (the screenshots illustrate katakana and hiragana characters, but I can't tell whether it supports Korean characters or any of the character sets derived from the traditional Chinese character set, which in general require multiple keystrokes to compose.)

-- fate

Re: Add special chars to the GUI...

Posted: 14 Jun 2008, 18:04
by Crush
The client for the new server does already support UTF-8 by using true type fonts. We decided to use the font DejaVu, because it is free and contains a very wide array of characters.

Re: Add special chars to the GUI...

Posted: 15 Jun 2008, 06:09
by leeor_net
Languages that do not use the typical Latin characters will require different font faces (e.g., Hebrew, Arabic, Russian, Greek, Chinese, Japanese, etc.). I don't know how many (if any) TTF fonts are avaible for these languages that would be clearly readable in a game although it's definitly worth looking into.

Re: Add special chars to the GUI...

Posted: 15 Jun 2008, 09:00
by Ces
All the games I’ve looked in a bit on behind the scenes use either their own sprites or ship TTFs. I keep wondering if it wouldn’t be possible for the game(s) to make use of any font the system knows about, perhaps with a preferential choice? And/or, that the font of preference will substitute the lacking glyphs from other fonts.

As of now DejaVu lacks coverage of many Eastern scripts, including CJK (Chinese/Japanese/Korean), Thai, Gurmukhi among others. But it’s still one of the free fonts with widest repertoire.

References
http://dejavu.svn.sourceforge.net/viewv ... iew=markup
http://en.wikipedia.org/wiki/Global_int ... e_Internet

EDIT
leeor_net wrote:Languages that do not use the typical Latin characters will require different font faces (e.g., Hebrew, Arabic, Russian, Greek, Chinese, Japanese, etc.). I don't know how many (if any) TTF fonts are avaible for these languages that would be clearly readable in a game although it's definitly worth looking into.
There exists quite a few free true/open type fonts for the languages/language groups you listed. And when I say free I mean open/free with appropriate licenses. Some more recent languages (as appearing on the ’net and with inclusal in Unicode) have far less free font choices. See for instance the websites of Alan Wood and UniFont.