views:

79

answers:

0

Hello All!

My Android Application needs support for various languages (like Chinese etc.). Most of them are in the DroidSansFallback.ttf file from Ascender.

See http://android.git.kernel.org/?p=platform/frameworks/base.git;a=tree;f=data/fonts;hb=HEAD

On some Android Phones, there is DroidSansFallback.ttf, but with many glyphs missing, e.g. on the NexusOne that is distributed in the USA. There are no Asian Fonts Glyphs at all, mostly only Latin and related characters.

So what to do?

I added to the "assets" my own copy of DroidSansFallback.ttf (I also tried other fonts from other sources) and set it during runtime using the Typeface Class.

With some phones and some .ttf files, the font rendering gets completely screwed up, means the letters are just some dots in one line.

After deeper analysis, the problem boils down to:

  1. Small .ttf files seem to always work (<200kB)
  2. Large .ttf files don't work at all (>3MB)
  3. If the phone has the full DroidSansFallback.ttf installed (which is ~3.5MB), even an 1 or 2MB font screws up. If the phone has only a "lite" Version of DroidSansDallback.ttf installed (which is ~1MB), a 3MB font works fine.

Whats wrong here? Am I missing something? It looks like all installed/used Fonts together cannot be larger than somehwat ~4MB.

Anyone has experienced the same problem? I tried it on NexusOne (2.1), HTC Hero(2.1), SonyEricson Xperia (1.6) and Motorola MileStone(2.0), all show the same behaviour.

Thanks for any hints.