2014-05-24 29 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