Android: Arabic font

前端 未结 2 1173
孤街浪徒
孤街浪徒 2020-12-15 15:04

I am trying to parse an XML file which contains complex arabic letters ..

When i tested on android 2.3.7, not all arabic letters are supported, there is still some c

2条回答
  •  鱼传尺愫
    2020-12-15 15:23

    try this solution:

    get the roboto font as used on android 4 , from here. if that doesn't work , you can try out other fonts , such as the DejaVu font . other fonts are available here for example .

    then , put the file into your assets folder , and for each of the views that need to show text (like textView) , use the font :

    Typeface face = Typeface.createFromAsset(getAssets(), "Roboto-Regular.ttf");
    textview.setTypeface(face);
    

    i've tried hebrew in the past and it showed fine . sadly , the special dots (called "NIKUD") didn't show so well so you might have similar problems for arabic .

提交回复
热议问题