I am showing a list of languages to select for the user. I am running on Android 4.1.1 and on a rooted device.
<string name="g_lang_English">English</string>
<string name="g_lang_Bahasa">Bahasa</string>
<string name="g_lang_Tamil">தமிழ்</string>
<string name="g_lang_Bengali">বাংলা</string>
<string name="g_lang_Chinese">华语</string>
<string name="g_lang_Vietnamese">Việt</string>
<string name="g_lang_Thailand">ภาษาไทย</string>
<string name="g_lang_Khmer">ភាសាខ្មែរ</string>
All the languages are shown correctly except for Khmer (Last one). It's empty. This is because by default Khmer font is not installed I assume.
So then I tried and manually set the type face for each TextView using
textView.setTypeface(Typeface.createFromFile("/sdcard/Smart Unicode Body Regular.ttf"));
which worked just as I wanted. However I was surprised that it worked for all the other fonts and not Khmer so I pushed the font I used to to /system/fonts
. But still it doesn't work if I don't manually set the typeface using Java.
How does Android decide which installed font to use to display the text in the TextView ?
What should I do to configure Android to display Khmer without having to manually set the font using setTypeface
?