Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Efficient font rendering for languages with many glyphs?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 swb   Members   -  Reputation: 115

Like
0Likes
Like

Posted 13 August 2012 - 11:59 PM

For Latin fonts I was planning to render all the glyphs to a texture atlas (and that seems to be what people suggest doing), but looking at Japanese fonts with possibly 10k glyphs, or fallback fonts for internationalization that cover the entire unicode basic multilingual plane (64k glyphs), I'm concerned that doing that naively is going to be a disaster in both ram use and number of textures. I figure this is a common problem as there are a lot of Asian and multilingual games, but I couldn't find any info on it. How would you do it?

Sponsor:

#2 Krohm   Crossbones+   -  Reputation: 3261

Like
0Likes
Like

Posted 14 August 2012 - 12:53 AM

Many people would just rely on FreeType.
I use uniscribe instead, with an LRU scheme on a large cache. The cache evicts seldom used glyphs when exceeding a certain memory threshold. I think it's about 8 MiB for now but it never kicked in. Note Uniscribe appears to have its own cache as well.

#3 Murdocki   Members   -  Reputation: 274

Like
0Likes
Like

Posted 15 August 2012 - 02:36 AM

The answer kind of depends on how you are using text in your game.
I've been working on several games where all text was predetermined. We just extracted all texts for a specific language from our localization database and ran this through BMfont (http://www.angelcode.com/products/bmfont). This tool allows you to create font textures only containing characters found in a specified file. This removed the need for us to include the font itself (which was about 12MB, too huge).

If you're using texts for chat or something you would need to include the font since you dont know which characters users will use. Like Krohm suggets you could use some caching. Maybe you can even swap in and out characters that are or arent currently used, if you are doing this maybe you can place your characters in an evenly spaced grid so that you wont have issues with replacing small characters with large ones.

#4 mikiex   Members   -  Reputation: 244

Like
0Likes
Like

Posted 19 August 2012 - 03:59 AM

You could try using signed distance fields if these are bitmap fonts to save some memory.
I second what Murdock says, projects I have worked on that required japanese we scan through all the text looking for all the unique unicode. We then created a bitmap font based on this. The font wasn't too big, but with more characters packed into the same amount of space we used on the european font means the quality is reduced (was acceptable to the Japanese publisher)




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS