안드로이드에 .XML이있을 수 있습니다
<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/DefaultFontText"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="30sp"
android:text="Here is some text." />
<TextView
android:id="@+id/CustomFontText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="30sp"
android:text="Here is some text.">
</TextView>
쓰기 다음 코드를
직접 우리의 자산의 글꼴 폴더를 생성 otf 및 ttf 형식을 모두 지원하므로 둘 다 경험했습니다.
tv3 = (TextView)findViewById(R.id.tv1);
Typeface typeFace = Typeface.createFromAsset(getAssets(), "fonts/TRAJANPRO-BOLD.OTF");
tv3.setTypeface(typeFace);
이
은
그것은 사용자 정의 글꼴을 사용하기 쉽게 만들 안드로이드 라이브러리 내가
당신이 자산/글꼴 폴더에 액세스 서체 얼굴에있는 글꼴을 가질 수 단정 할 수 ..to; face = Typeface.createFromAsset (getAssets(), "fonts /"+ "font.otf"); textview.setTypeface (face); –