• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
slicer4ever

Handling other languages and font.

8 posts in this topic

my current font system is pretty simple, at the game launch, I build a texture palette of common letters, with ascii this is generally between glyphs 32 to 96 covers the English language pretty decently.  Then when i draw a string, I just create a mesh, with the appropriate texture coordinates for the glyph, and do a check that the glyph is inside my range of supported glyphs.

 

However, i've been thinking of how to extend this to other languages, my palette system can be modified to use unicode glyphs relatively easily, but I don't know what a good range is for covering a good variety of common characters in say Chinese, Japanese, french, German, russian etc.  since the input from players is likely going to be in their language, rather than english(particularly if targeting mobile platforms), these would mean that when i'm drawing something with my font code, it wouldn't draw anything as all the input glyphs could be outside my supported range.  creating a texture with all possible glyphs seems rather insane as well.  I've also considered having "pages" of textures, but that would be rather inefficient as it means having to switch textures every time a glyph in a different "page" is detected.

 

so what are other people's solutions for dealing with this problem?

0

Share this post


Link to post
Share on other sites

creating a texture with all possible glyphs seems rather insane as well.  I've also considered having "pages" of textures, but that would be rather inefficient as it means having to switch textures every time a glyph in a different "page" is detected.

 

That's usually how it's done. You can make it more efficient by drawing all your glyphs from one page before changing the texture (need to prepass the string and batch the location and image uv's of glyphs from each page, then draw a page at a time).

1

Share this post


Link to post
Share on other sites
To get a minimum passable support you need to support at least every code point between 0 and 65535 (thous that have anything valid defined). To get a reasonably good support one should also support combining characters and code points above 65535.

Generating any texture to cover it is impossible. You have to generate and prune them on the fly as needed and possibly combine them yourself in the CPU side as GPU tends to be very inefficient/limiting to hack text together.
1

Share this post


Link to post
Share on other sites

For EFIGS (English, French, German, Italian, Spanish) the ANSI range between 0-256 should suffice.

 

When you add more exotic languages (e.g. Japanese), then there's really two options:

 

1. Tie an offline font generation tool into your localisation spreadsheet so that you can generate a list of required glyphs, and output just the ones that are required, plus maybe a few extras for user input (e.g. roman alphabet, common punctuation and hiragana/katakana alphabets).

2. Generate the glyphs you need on the fly from a truetype font using a library like FreeType.

 

The advantage of #1 is that the performance and memory impact is more predictable, it's the approach I've always used on console/handheld games. The advantage of #2 is that it's more flexible, particularly for user input.

 

I'd say that if your user input is quite a small part of the game (e.g. player enters their name for multiplayer), then use approach #1 as it's probably easier to implement and easier to test. I think Chinese/Japanese games players are quite used to having restricted characters for name entry.

 

If text entry is central to your app (e.g. a messaging app or something), then go with option 2.

2

Share this post


Link to post
Share on other sites

Thanks everybody for the input.  I think my best bet is going to be using something like the bmfont tool with pre-parsing text to draw as many of the glpyhs on the same texture as possible in as few passes as possible.

0

Share this post


Link to post
Share on other sites
Note that not all fonts are equal when it comes to rendering East Asian languages. For instance, there are some characters that are written differently in Japanese and Simplified Chinese that share the same unicode code point. Same with traditional Chinese and simplified Chinese. Getting it right for the different languages involves using the right font for each supported language. What's worse is that a font for one language may not have the information for characters from another language. So if you use a Japanese font for Chinese text occasionally you'll get the outcome where it looks like your text is rendered in two different fonts. What's happening is that font fallback kicks in for the unknown characters and the system tries to find a font that does support that language, so you really are rendering in two different fonts at the same time. Needless to say, this all adds up to quite a bit of a pain in the rear if you want "proper" East Asian language support.
1

Share this post


Link to post
Share on other sites

If you want to support all Unicode characters for which you have fonts in arbitrary user input, you could use fonts directly in the input phase (with the game paused, inefficiency should be tolerable) and then build a texture atlas at runtime containing either the actually used characters or rendered strings.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0