내 앱에 맞춤 글꼴을 추가하는 동안 시간이 많이 걸립니다. 하지만 대부분의 경우 원활하게 실행됩니다.내 앱에 맞춤 글꼴을 추가하는 경우
다음 코드를 사용하고 있습니다.
try {
// Get the typeface
ShravyaApp.appTypeFace = Typeface.createFromAsset(getApplication().getAssets(),
"kadage.ttf");
Log.d("font","in type="+ShravyaApp.fontName);
Log.d("font","type face="+ShravyaApp.appTypeFace);
}
catch (Exception e)
{
ShravyaApp.appTypeFace = Typeface.createFromAsset(getApplication().getAssets(),
"kadage.ttf");
Log.d("font","in catch typr="+ShravyaApp.fontName);
Log.d("font","type face="+ShravyaApp.appTypeFace);
//Log.e(TAG, "Could not get typeface '" + + "' because " + e.getMessage());
e.printStackTrace();
}
내가지고있어 오류 :
NullPointerException at android.graphics.Typeface.nativeCreateFromAsset(Native Method) at android.graphics.Typeface.createFromAsset(Typeface.java:280)
글꼴 파일을 저장할 폴더는 무엇입니까? –