使用android系统中的外部字体 [英] Use external fonts in android

查看:137
本文介绍了使用android系统中的外部字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用外部字体在我的应用程序。我曾尝试添加使用资产管理公司的新字体,但没有奏效。

i want to use external fonts in my app. i have tried adding new fonts using asset managers but it did not work.

Typeface face;

face = Typeface.createFromAsset(getAssets(), "font.otf");

textview.setTypeface(face);

但它没有显示文本...

but it did not show the text...

plz帮助..

推荐答案

AFAIK,Android不支持OpenType字体。使用TrueType字体代替。

AFAIK, Android does not support OpenType. Use a TrueType font instead.

更新:显然OpenType字体现在支持,至少在某种程度上。它不支持原,所以你会想在任何的Andr​​oid版本的应用程序将支持彻底测试你的字体。

UPDATE: Apparently OpenType is now supported, at least somewhat. It was not supported originally, so you will want to test your font thoroughly on whatever versions of Android your app will support.

这篇关于使用android系统中的外部字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆