public static Typeface getTypeFace(Context context, String type) {
if ("bold".equals(type)) {
return Typeface.createFromAsset(context.getAssets(),
"Gotham-Rounded-Book_21018.ttf");
} else if ("normal".equals(type)) {
return Typeface.createFromAsset(context.getAssets(),
"Gotham-Rounded-Light_21020.ttf");
} else if ("italic".equals(type)) {
return Typeface.createFromAsset(context.getAssets(),
"HelveticaItalic.ttf");
}
return Typeface.createFromAsset(context.getAssets(),
"HelveticaNormal.ttf");
}
public static Typeface getTypeFace(Context context) {
return getTypeFace(context, "normal");
}
注:字体文件放在assets文件中