안드로이드에 간단한 새 애플리케이션을 작성하고 Activity 위젯에 setTypeface를 사용하고 싶습니다.안드로이드 setTypeface가 올바르게 작동하지 않습니다.
그것은 올바른 그게 전부 것이 아래 코드에서하지만 난 콘솔에서이 오류를 얻을 :
1803-1803/com.example.AndroidMultiPage E/AndroidRuntime﹕
FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.example.AndroidMultiPage/
com.example.AndroidMultiPage.MyActivity}:
java.lang.RuntimeException:
native typeface cannot be made
글꼴 경로 : assets/font/BZar.ttf
내 간단한 코드 :
package com.example.AndroidMultiPage;
import android.app.Activity;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Typeface;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import org.w3c.dom.Text;
public class MyActivity extends Activity {
private Button submit;
/**
* Called when the activity is first created.
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Typeface face = Typeface.createFromAsset(getAssets(),
"font/BZar.ttf");
Button submit = (Button) findViewById(R.id.submitButton);
submit.setTypeface(face);
}
다른 글꼴을 사용해보십시오. 어떤 이유로 든 모든 글꼴이 Android와 호환되는 것은 아닙니다. – CommonsWare
http://stackoverflow.com/questions/12766930/native-typeface-cannot-be-made-only-for-some-people – nobalG