Android 上的自定义字体会降低性能吗?
Do Custom Fonts on Android decrease performance?
我打算制作一个 android 应用程序,并希望使用自定义字体来匹配想要该应用程序的品牌提供的样式指南。
我发现这个库 Caligraphy 可以使用自定义字体。
- 使用自定义的应用程序性能是否存在问题
这个库的字体?
- 是否有其他选项可以轻松添加自定义字体?
- 此外,是否有防止在 android 应用程序中使用自定义字体的指南,或者这是一种不好的做法?
- Is there an issue regarding performance of the app by using custom fonts with this library?
自定义字体通常没有任何问题,这个库没有理由会影响应用程序的性能
- Is there another option to add custom fonts painlessly?
是的,您可以通过简单的编码轻松实现此目的
TextView txt = (TextView) findViewById(R.id.textview);
Typeface font = Typeface.createFromAsset(getAssets(), "your_font.ttf");
txt.setTypeface(font);
- Also, is there a guideline that prevents from using custom fonts in android apps, or is it a bad practice?
不,这不是一个坏习惯。事实上 google 最近添加了一个选项来使用自定义字体和支持库 v26。您不必将 ttf 文件添加到 apk,google 将为您自行下载
我打算制作一个 android 应用程序,并希望使用自定义字体来匹配想要该应用程序的品牌提供的样式指南。
我发现这个库 Caligraphy 可以使用自定义字体。
- 使用自定义的应用程序性能是否存在问题 这个库的字体?
- 是否有其他选项可以轻松添加自定义字体?
- 此外,是否有防止在 android 应用程序中使用自定义字体的指南,或者这是一种不好的做法?
- Is there an issue regarding performance of the app by using custom fonts with this library?
自定义字体通常没有任何问题,这个库没有理由会影响应用程序的性能
- Is there another option to add custom fonts painlessly?
是的,您可以通过简单的编码轻松实现此目的
TextView txt = (TextView) findViewById(R.id.textview);
Typeface font = Typeface.createFromAsset(getAssets(), "your_font.ttf");
txt.setTypeface(font);
- Also, is there a guideline that prevents from using custom fonts in android apps, or is it a bad practice?
不,这不是一个坏习惯。事实上 google 最近添加了一个选项来使用自定义字体和支持库 v26。您不必将 ttf 文件添加到 apk,google 将为您自行下载