问题
What font file types does Android support (for use with Typeface.createFromAsset, for instance)?
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?
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?
回答1:
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").
回答2:
http://www.androidguys.com/2008/08/18/fun-with-fonts/
Use external fonts in 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.
来源:https://stackoverflow.com/questions/8760709/what-font-file-types-does-android-support