In which android version the cursive font is available?

穿精又带淫゛_ 提交于 2019-12-08 08:49:11

问题


In my Android app i set the style of my TextView like this:

<TextView
            android:fontFamily="cursive" 
            android:textStyle="normal|bold" 
            ...
/>

For example in Lollipop will work because there is the cursive font by default: see here

Now I'd like to know in which version there isn't the cursive font.

p.s.

cursive font=DancingScript-Regular.ttf


回答1:


It's weird. The cursive font family is officially available starting at API level 16 (Jellybean). However, it uses the DroidSerif font which is not a cursive looking font. By API 21, they move to the DancingScript font which looks far more cursive like.

So, you may be able to use the keyword in API 16-20, but it won't amount to much. From API levels 21+, it should look very much like cursive script.

You can look at the available fonts if you go here:

{ANDROID-SDK-HOME}/platforms/android-{SDK-INT}/data/fonts

The containing system-fonts.xml has all them listed with the corresponding fonts.




回答2:


Actually cursive font family shouldn't be available form android device. Over here you can find perfect explanation what you can set using fontFamily and textStyle.

If you want to use custom fonts I strongly recommend Calligraphy lib.



来源:https://stackoverflow.com/questions/40588559/in-which-android-version-the-cursive-font-is-available

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!