我有一种字体,我必须在我的应用程序中使用,但在小屏幕上看起来有点隐约,所以我想让它变得粗体。如何在AndEngine中使用斜体或粗体字体创建自定义字体?
我用这个代码:
font = FontFactory.createFromAsset(fontTextureAtlas, this, "Noteworthy.ttc", 20f, true, Color.BLUE);
但是没有选择不化妆字体加粗,所以我试图用FontFactory.create()
:
AssetManager mgr = AssetManager.class.newInstance();
font = FontFactory.create(fontTextureAtlas,
Typeface.create(Typeface.createFromAsset(mgr,"Noteworthy.ttc"),Typeface.BOLD),
20f,
true,
Color.BLUE);
但我得到这个:
ERROR/AndroidRuntime(2140): FATAL EXCEPTION: main
java.lang.RuntimeException: native typeface cannot be made
我没有更多的想法如何使这个字体粗体。 enyone知道该怎么做吗?
这种字体绝对具有明亮而粗体的字体。 – 2012-08-03 10:04:14
好吧,它绝对有它。 [论坛网站关于设置字体样式为粗体](https://groups.google.com/forum/?fromgroups#!topic/android-developers/z5fKtEf6wRY)和[实际使用的方法](http://developer.android .com/reference/android/graphics/Paint.html#setFakeBoldText%28boolean%29)。 – Akyl 2012-08-03 13:59:32