Paint.setTypeface在斜体方面似乎无法正常工作,或者我做错了什么。我可以创建普通、粗体、等宽和衬线文字,但是无法创建斜体文字。它总是看起来很普通(或者在粗斜体的情况下看起来很粗)。
//This will appear monospace
paint.setTypeface(Typeface.MONOSPACE);
canvas.drawText("foo", 10, 10, paint);
//This will appear serif
paint.setTypeface(Typeface.SERIF);
canvas.drawText("foo", 10, 10, paint);
//This will appear bold
paint.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
canvas.drawText("foo", 10, 10, paint);
//This will NOT appear italic <=== PROBLEM
paint.setTypeface(Typeface.defaultFromStyle(Typeface.ITALIC));
canvas.drawText("foo", 10, 10, paint);
// This isn't working either <=== PROBLEM
paint.setTypeface(Typeface.create(Typeface.SANS_SERIF, Typeface.ITALIC));
现在的问题是:是否已经有针对此问题的已知解决方案? 我的简单目标是使用斜体样式绘制一些单词...