Henok
Henok

Reputation: 29

Displaying foreign language characters in Android Java

This is probably weird question, but I am trying to display Geez alphabets on an android app. Geez alphabets are used in Eritrea and Ethiopia. The unicode ranges from U+1200 and U+137F (decimal 4608–4991). More info can be found here: http://en.wikipedia.org/wiki/Ge'ez_script#Unicode

Currently, I have just added the characters directly to the name in strings.xml like:

enter image description here

But it's not displaying it when I run the App on other devices device. it works good on my Galaxy S4 because Geez alohabets are already included in this device by default.

How do I display such characters on devices that don't support it by defauly, if possible?

Btw, the xml is using utf-8 encoding

Upvotes: 0

Views: 414

Answers (1)

thinzar00
thinzar00

Reputation: 588

This is how I include Myanmar unicode fonts inside my apps, not sure it will be relevant to you.

  1. save a copy of font file (TTF) under assets/font
  2. extends the TextView to set the default typeface (In your case maybe EditText)

    private void init() {
    if (!isInEditMode()) {
    Typeface tf = Typeface.createFromAsset(getContext().getAssets(), "fonts/fontfile.ttf"); setTypeface(tf);
    }
    }

Upvotes: 1

Related Questions