How to rendering unicode characters(chinese)

Started by
1 comment, last by jmpep 10 years ago

I'm wondering how those MMO(like world of warcarft) games render unicode characters(Chinese). Typically, those games have a message system where you can type any word and display it. They can also show big chunk of words for "task description", "weapon description" and etc.

I used bitmap texture to render English characters in my engine, but bitmap texture for Chinese would be a memory eating monster considering there are roughly 10k of them. What technique do those games usually use to render unicode characters?

Advertisement
If you don't have player chat, you can look at all your description text to find the set of required characters and then build a bitmap font with just those chars in it.
If you do have user chat, you need a system that generates bitmap fonts at runtime from TTF/etc files. Creating characters as required and deleting unused ones after a while.

You can also save a lot of memory by using signed distance field bitmaps instead of RGBA images.

If you use OpenGL+FreeType, you can have a look at: https://code.google.com/p/freetype-gl/. If not, well, you still get to see an implementation of what Hodgman was saying :)

“We should forget about small efficiencies, say about 97% of the time; premature optimization is the root of all evil” - Donald E. Knuth, Structured Programming with go to Statements

"First you learn the value of abstraction, then you learn the cost of abstraction, then you're ready to engineer" - Ken Beck, Twitter

This topic is closed to new replies.

Advertisement