![](/img/trans.png)
[英]Android font ttf or otf typeface rendering random symblols/letters
[英]android typeface fill transparent areas in ttf
我在应用程序中使用ttf作为字体。 我使用的字体是: http : //www.dafont.com/unlearned-bitmap.font?nb_ppp=50
当我在textview上打印文本时,字体笔划及其周围的区域是透明的,因此我只能看到字体的黑色笔划。 当我设置textview的backgroundcolor时,黑色笔触内部的区域被着色,但笔触外部的区域也被着色。 有没有一种方法可以给字体内部着色,但不能给笔触周围的区域着色?
是的,请使用setTextColor()
Typeface tf = Typeface.createFromAsset(getContext().getAssets(), "CustomFont.ttf");
setTypeface(tf);
yourTextView.setTextColor(Color.RED);
Typeface tf = Typeface.createFromAsset(getContext().getAssets(), "AnyFont.ttf");
setTypeface(tf);
textview.setTextColor(this.getResources().getColor(R.color.orange));
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.