When using Canvas
and drawText()
method I see a different rendering on Android 4.2.1.
Below 4.2:
For Android 4.2.1 (Nexux 7) I get:
As you can see the text Consumption is very tight. Seems to be a kerning problem introduced in 4.2.1. The Paint used to draw text is nothing special:
titlePaint = new Paint();
titlePaint.setAntiAlias(true);
titlePaint.setColor(0xffffffff);
titlePaint.setTextSize(0.125f);
titlePaint.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
titlePaint.setTextAlign(Align.CENTER);
titlePaint.setLinearText(true);
If I don't use titlePaint.setLinearText(true)
I get a strange result on 4.2.1 as you can see there:
Android 4.2 on Nexus 7: canvas.drawText() not working correctly
EDIT:
This strange behaviour has been reported to the Android team: http://code.google.com/p/android/issues/detail?id=39755 but it's still not a "official" issue.
EDIT (2):
Some rumors claim that the problem is a textSize < 1.0f...