在styles.xml设置特定的字体字体、styles、xml

2023-09-12 11:30:45 作者:胸怀无限大

我定义XML样式为我的Andr​​oid应用程序。我有我想要使用一些TTF文件,我怎么可以设置为使用这些文件,而不是一般的SANS,衬线和功放的字体的字体; 等宽。谢谢

I'm defining a style XML for my android app. I have some TTF files I want to use, how can I set the typeface to use those files as the font as opposed to the generic "sans", "serif" & "monospace". Thanks

推荐答案

您只能通过Java code使用自定义字体,而不是通过布局XML或样式/主题 - !对不起

You can only use custom fonts via Java code, not through layout XML or styles/themes -- sorry!