Add special chars to the GUI...

Content and general development discussion, including quest scripts and server code. TMW Classic is a project comprising the Legacy tmwAthena server & the designated improved engine server based on evolHercules.


Forum rules

This forum houses many years of development, tracing back to some of the earliest posts that exist on the board.

Its current use is for the continued development of the server and game it has always served: TMW Classic.

Post Reply
User avatar
KaTSuo
Novice
Novice
Posts: 53
Joined: 25 Sep 2005, 19:01
Location: France
Contact:

Add special chars to the GUI...

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

Post 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.
  • 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, 19:48
Location: Bern, Switzerland

Post 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.
This message used to be meaningful.
User avatar
Crush
TMW Adviser
TMW Adviser
Posts: 8046
Joined: 25 Aug 2005, 16:08
Location: Germany

Post by Crush »

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
Grand Knight
Grand Knight
Posts: 1759
Joined: 07 Aug 2004, 10:47
Location: Germany->Bavaria

Post 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
User avatar
Rotonen
TMW Adviser
TMW Adviser
Posts: 3154
Joined: 08 Sep 2004, 19:48
Location: Bern, Switzerland

Post by Rotonen »

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, 09:02
Location: China

Re:

Post 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?
User avatar
fate
Warrior
Warrior
Posts: 402
Joined: 20 Mar 2008, 14:34

Re: Add special chars to the GUI...

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

Re: Add special chars to the GUI...

Post 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.
  • 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, 09:17
Location: Ohio, USA
Contact:

Re: Add special chars to the GUI...

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

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

Re: Add special chars to the GUI...

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