android Typeface使用TTF字体文件设置字体 发表于 2011-05-09 更新于 2022-11-07 分类于 Android开发 我们可以在程序中放入ttf字体文件,在程序中使用Typeface设置字体。 第一步,在assets目录下新建fonts目录,把ttf字体文件放到这。 第二步,程序中调用: AssetManager mgr=getAssets();//得到AssetManager Typeface tf=Typeface.createFromAsset(mgr, "fonts/ttf.ttf");//根据路径得到Typeface tv.setTypeface(tf);//设置字体