Non ASCII text support

Discussion in 'Game Development (Technical)' started by Hideo, Dec 17, 2008.

  1. Hideo

    Hideo New Member

    Joined:
    Jul 29, 2008
    Messages:
    97
    Likes Received:
    0
    I would like to support different languages in my current project. Currently I plan to have German, French, US English, UK English and Polish version. Only text will be localized. The problem I'm facing is how to support non-ASCII chars?
     
  2. Kneehat

    Kneehat New Member

    Joined:
    Feb 5, 2007
    Messages:
    25
    Likes Received:
    0
    I guess it depends on how you store and render your text but personally, I use UTF-8 throughout our engine. It is very easy to retro-fit to an existing code-base.
     
  3. Richard Nunes

    Richard Nunes New Member

    Joined:
    Nov 10, 2008
    Messages:
    201
    Likes Received:
    2
    Support UTF-8 or Unicode.

    What applications or engines are you using? I wager every commercial application supports UTF-8 (Notepad does). That will let you localize to any language.
     
  4. Hideo

    Hideo New Member

    Joined:
    Jul 29, 2008
    Messages:
    97
    Likes Received:
    0
    Thx. Most fonts support only ASCII. Which font do you prefer for multilingual content?

    Edit: I use custom engine. Raw C++, DX9.0c, Win32.
     
    #4 Hideo, Dec 17, 2008
    Last edited: Dec 17, 2008
  5. Kneehat

    Kneehat New Member

    Joined:
    Feb 5, 2007
    Messages:
    25
    Likes Received:
    0
  6. Applewood

    Moderator Original Member Indie Author

    Joined:
    Jul 29, 2004
    Messages:
    3,858
    Likes Received:
    2
    There are two levels of scaling up for this.

    All the EFIGS glyphs are in am extended ASCII codepage that is usually called ISO-LATIN1. It just so happens that this overlaps perfectly with the first 256 characters of unicode. So if all you want is EFIGS, you can still use bytes for your strings and standard font tools to get your characters out similar to however you do it now.

    If you want "weird" alphabets like Cyrillic etc., then what I do is make my font export tool save out a big chart of used glyphs based on the localised text input you give it. Keep your strings in a file, pass this file into the tool - it can then save out the strings as 2byte characters and some rectangles for where their images went. I use freetype in my tool and TTF fonts that actually have all the unicode stuff in em - which are actually pretty few as you'd imagine.

    The above isn't the only way, but it works great for me. All the grunt work is done by a totally automated offline tool and my string class in game already uses w_char so it all just works.
     
  7. Hideo

    Hideo New Member

    Joined:
    Jul 29, 2008
    Messages:
    97
    Likes Received:
    0
    I think I will implement just ISO-8859-1. What tool allows easy rendering of arbitrary glyph sets and saves binary metrics?
     
  8. Applewood

    Moderator Original Member Indie Author

    Joined:
    Jul 29, 2004
    Messages:
    3,858
    Likes Received:
    2
    I think I mentioned it already ;)
     

Share This Page

  • About Indie Gamer

    When the original Dexterity Forums closed in 2004, Indie Gamer was born and a diverse community has grown out of a passion for creating great games. Here you will find over 10 years of in-depth discussion on game design, the business of game development, and marketing/sales. Indie Gamer also provides a friendly place to meet up with other Developers, Artists, Composers and Writers.
  • Buy us a beer!

    Indie Gamer is delicately held together by a single poor bastard who thankfully gets help from various community volunteers. If you frequent this site or have found value in something you've learned here, help keep the site running by donating a few dollars (for beer of course)!

    Sure, I'll Buy You a Beer