Add special chars to the GUI...

Content and general development discussion, including maps, quests, and server code from the development team.
Post Reply
User avatar
KaTSuo
Peon
Peon
Posts: 53
Joined: 25 Sep 2005, 20:01
Location: France
Contact:

Add special chars to the GUI...

Post by KaTSuo » 10 Jan 2007, 18:54

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{|}~|"
                "áÃ
I'm French, sorry for my bad english XD !
Image
User avatar
Crush
TMW Adviser
TMW Adviser
Posts: 8046
Joined: 25 Aug 2005, 17:08
Location: Germany

Post by Crush » 10 Jan 2007, 19:07

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.
  • former Manasource Programmer
  • former TMW Pixel artist
  • NOT a game master

Please do not send me any inquiries regarding player accounts on TMW.


You might have heard a certain rumor about me. This rumor is completely false. You might also have heard the other rumor about me. This rumor is 100% accurate.
User avatar
Rotonen
TMW Adviser
TMW Adviser
Posts: 3154
Joined: 08 Sep 2004, 20:48
Location: Espoo, Finland

Post by Rotonen » 11 Jan 2007, 11:13

On the long run we should just go for UTF-8, though. We will no doubt have asian players too on the long run.
This message used to be meaningful.
User avatar
Crush
TMW Adviser
TMW Adviser
Posts: 8046
Joined: 25 Aug 2005, 17:08
Location: Germany

Post by Crush » 11 Jan 2007, 17:20

You mean implementing the whole unicode character set? Rotonen, do you know how many characters are included in it? Tens of thousands!
  • former Manasource Programmer
  • former TMW Pixel artist
  • NOT a game master

Please do not send me any inquiries regarding player accounts on TMW.


You might have heard a certain rumor about me. This rumor is completely false. You might also have heard the other rumor about me. This rumor is 100% accurate.
Matt
Knight
Knight
Posts: 1746
Joined: 07 Aug 2004, 11:47
Location: Germany->Bavaria

Post by Matt » 11 Jan 2007, 18:04

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
User avatar
Rotonen
TMW Adviser
TMW Adviser
Posts: 3154
Joined: 08 Sep 2004, 20:48
Location: Espoo, Finland

Post by Rotonen » 11 Jan 2007, 18:51

We're planning on using TTF for fonts in the future so UTF-8 would be the best choice, right?
This message used to be meaningful.
xmlie
Peon
Peon
Posts: 1
Joined: 14 Jun 2008, 10:02
Location: China

Re:

Post by xmlie » 14 Jun 2008, 10:27

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?
User avatar
fate
Novice
Novice
Posts: 400
Joined: 20 Mar 2008, 15:34

Re: Add special chars to the GUI...

Post by fate » 14 Jun 2008, 17:30

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
User avatar
Crush
TMW Adviser
TMW Adviser
Posts: 8046
Joined: 25 Aug 2005, 17:08
Location: Germany

Re: Add special chars to the GUI...

Post by Crush » 14 Jun 2008, 19:04

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.
  • former Manasource Programmer
  • former TMW Pixel artist
  • NOT a game master

Please do not send me any inquiries regarding player accounts on TMW.


You might have heard a certain rumor about me. This rumor is completely false. You might also have heard the other rumor about me. This rumor is 100% accurate.
User avatar
leeor_net
Novice
Novice
Posts: 180
Joined: 03 Feb 2008, 10:17
Location: Ohio, USA
Contact:

Re: Add special chars to the GUI...

Post by leeor_net » 15 Jun 2008, 07:09

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.
- Leeor

"Oh, no thanks. I ate a boulder on the way in." - Shrek
User avatar
Ces
Novice
Novice
Posts: 231
Joined: 19 Mar 2008, 23:46
Location: The hemisphere

Re: Add special chars to the GUI...

Post by Ces » 15 Jun 2008, 10:00

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.
Post Reply