Android支持哪些字体文件类型?

时间:2021-05-09 16:28:59

What font file types does Android support (for use with Typeface.createFromAsset, for instance)?

Android支持哪些字体文件类型(例如,与Typeface.createFromAsset一起使用)?

I can't seem to find a list in the documentation. I can see TTF gets mentioned in some tutorials and someone on here hinted that OTF is also supported now but is there a comprehensive list that shows what font file types are supported by the different API levels?

我似乎无法在文档中找到列表。我可以看到TTF在一些教程中被提及,而且这里有人暗示现在也支持OTF,但有一个全面的列表,显示不同API级别支持哪些字体文件类型?

Many thanks.

EDIT: to be specific: can someone show me where it mentions font compatibility and supported font types in the docs - if there is anything there?

编辑:具体:有人可以告诉我它在文档中提到字体兼容性和支持的字体类型 - 如果有什么?

2 个解决方案

#1


7  

Android docs doesn't specify the fonts that it supports.When Android dislikes a custom font, rather than raising an Exception, it seems to substitute Droid Sans ("sans").

Android文档没有指定它支持的字体。当Android不喜欢自定义字体,而不是提出异常时,它似乎取代了Droid Sans(“sans”)。

#2


21  

http://www.androidguys.com/2008/08/18/fun-with-fonts/

Use external fonts in android

在android中使用外部字体

TTF is always been supported. OTF was later added at least in 1.6 and later, but partially. Some TTF fonts Android doesn't like.

始终支持TTF。 OTF后来至少在1.6及以后加入,但部分加入。 Android的一些TTF字体不喜欢。

#1


7  

Android docs doesn't specify the fonts that it supports.When Android dislikes a custom font, rather than raising an Exception, it seems to substitute Droid Sans ("sans").

Android文档没有指定它支持的字体。当Android不喜欢自定义字体,而不是提出异常时,它似乎取代了Droid Sans(“sans”)。

#2


21  

http://www.androidguys.com/2008/08/18/fun-with-fonts/

Use external fonts in android

在android中使用外部字体

TTF is always been supported. OTF was later added at least in 1.6 and later, but partially. Some TTF fonts Android doesn't like.

始终支持TTF。 OTF后来至少在1.6及以后加入,但部分加入。 Android的一些TTF字体不喜欢。