【问题标题】:How to integrate a special font (.ttf) in an Android application?如何在 Android 应用程序中集成特殊字体 (.ttf)?
【发布时间】:2013-05-19 11:25:24
【问题描述】:

我想添加一个文件 .ttf 以便能够在我的应用程序中自定义我的 textView 的字体。

不知道怎么被利用了?

我在DaFont下载文件。

提前感谢您的帮助!

【问题讨论】:

标签: java android textview customization


【解决方案1】:

首先,将字体复制到你项目中的/assets文件夹中,然后设置TextViewTypeface,你可以这样做:

Typeface myFont = Typeface.createFromAsset(getAssets(), "dafont.ttf");
myTextView.setTypeface(myFont);

编辑:更正目录

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-04-15
    • 2018-11-10
    • 2013-11-09
    • 2010-09-30
    • 2011-11-29
    • 1970-01-01
    相关资源
    最近更新 更多