2014-05-24 28 views
0

我對android應用程序開發非常陌生。我的第一個應用程序是一個基於文本的傳記應用程序,其中包含阿薩姆文本(印度語言)。我已經有了用Unicode編寫的所有文本。我想要的只是在應用程序中使用此文本。如何在Android應用程序中顯示阿薩姆文本?

如何確保字體顯示正確?

我必須替換任何字體嗎?

請讓我知道任何可能有幫助的資源。

謝謝。

回答

0

如果以Unicode文本,你可以簡單地把它的TextView其放在裏面滾動型:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:padding="@dimen/activity_padding"> 

    <ScrollView 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_alignParentTop="true"> 

     <TextView 
      android:id="@+id/text" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:textSize="22dp"/> 

    </ScrollView> 
</RelativeLayout> 

把一個文本的TextView在這樣的方式:

String yourText = ...; 
TextView tv = (TextView) findViewById(R.id.text); 
tv.setText(yourText); 
+0

,所以我不必須運送任何專有字體,如其他一些線程中所建議的那樣?大! –

+0

我不檢查,但您可以嘗試使用Typeface.createFromAsset方法從文件加載您的字體,並通過TextView.setTypeface – DenisMath