字体文件解析

来源:互联网 发布:fifa17球员数据 编辑:程序博客网 时间:2024/05/14 07:18
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文件中

0 0