Search code examples
androidfontsspecial-charactersdiacritics

Special characters with diacritics are shown as squares in Android


I'm developing application for android and I have there greek content with diacritics. Example:

ἑ ω ρά κα μεν ἐ θε α σά με θα ἔ θνε σιν πνεῦ μα

on android (standard font) I can see only squares or empty spaces instead of symbols "ἑ", "ά", "ῦ" etc...

Does anyone know how to solve this? Should I find some custom font that supports these symbols? Something else?


Solution

  • Android does not support these characters. http://code.google.com/p/android/issues/detail?id=26037

    Problem is fixed in Android 4.3

    Copy fonts from android 4.3 release and use as custom font in application to support old android devices.

    TextView tv = (TextView) findViewById(R.id.test);
    Typeface typeface = Typeface.createFromAsset(getAssets(), "custom.ttf");
    tv.setTypeface(typeface);