1) thêm "phông chữ" thư mục bên trong "tài sản" thư mục và dán phông chữ trong các phông chữ thư mục
2) trong file layout:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:id="@+id/custom_font"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="मैं छात्र हूँ"
/>
3) Trong Hoạt động nơi bạn muốn đặt văn bản sử dụng mã bên dưới:
TextView txt = (TextView) findViewById(R.id.custom_font);
Typeface font = Typeface.createFromAsset(getAssets(), "hindifont.ttf");
txt.setTypeface(font);
Nguồn
2011-06-24 05:06:14
có thể trùng lặp của [Cách thêm phông chữ bên ngoài vào ứng dụng android tion.] (http://stackoverflow.com/questions/5634245/how-to-add-external-fonts-to-android-application) –