Android自定义字体创建错误
用户可以在我的应用程序中选择不同的字体 字体是在以下代码中创建的:Android自定义字体创建错误,android,fonts,textview,typeface,Android,Fonts,Textview,Typeface,用户可以在我的应用程序中选择不同的字体 字体是在以下代码中创建的: public static Typeface getTypeFace(Context context, String assetPath) { synchronized (cache) { if (!cache.containsKey(assetPath)) { try { Typeface typeFace = Typeface.createFro
public static Typeface getTypeFace(Context context, String assetPath) {
synchronized (cache) {
if (!cache.containsKey(assetPath)) {
try {
Typeface typeFace = Typeface.createFromAsset(
context.getAssets(), assetPath);
cache.put(assetPath, typeFace);
} catch (Exception e) {
return null;
}
}
return cache.get(assetPath);
}
}
字体创建时没有错误,但在Android>5.0中,字体完全错误
当我在Android 4.4.2操作系统上使用我的应用程序时,它的创建是正确的
造成麻烦的字体是:
你知道怎么处理吗