繁体   English   中英

如何检查 Android 设备上安装的 Fonts

[英]How to check Installed Fonts on Android Device

我们要检查安装的 android 设备 fonts,我们可以在 android ZD52387880E1EA5228117A72D 中检查它吗?

Android中只有三个系统范围的fonts; 普通(Droid Sans)、衬线(Droid Serif)和等宽(Droid Sans Mono)。

应用程序可以为自己安装 fonts,但不能在系统范围内使用。

到 package 自己的字体,包括一个 truetype 字体文件(.ttf)作为资产并使用字体class 来加载它,并使用 Z622DC6E792DB10F121FCBD3FC034C064 的setTypeface方法来加载它。

要使用特殊字体,请创建普通 TextView:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
          android:orientation="vertical"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent">

<TextView
        android:id="@+id/custom_font"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="This is the Chantelli Antiqua font."/>

</LinearLayout>

然后从资产设置自定义字体(这是您想要的字体):

    TextView txt = (TextView) findViewById(R.id.custom_font);
    Typeface font = Typeface.createFromAsset(getAssets(), "Chantelli_Antiqua.ttf");
    txt.setTypeface(font);

代码来自: http://mobile.tutsplus.com/tutorials/android/customize-android-fonts/

我希望我能帮上忙。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM