Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid 4.2.1 wrong character kerning (spacing)
    primarykey
    data
    text
    <p>When using <code>Canvas</code> and <code>drawText()</code> method I see a different rendering on Android 4.2.1.</p> <p>Below 4.2:</p> <p><img src="https://i.stack.imgur.com/qZPju.png" alt="enter image description here"></p> <p>For Android 4.2.1 (Nexux 7) I get:</p> <p><img src="https://i.stack.imgur.com/vODlL.png" alt="enter image description here"></p> <p>As you can see the text <em>Consumption</em> is very tight. Seems to be a kerning problem introduced in 4.2.1. The Paint used to draw text is nothing special:</p> <pre><code>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); </code></pre> <p>If I don't use <code>titlePaint.setLinearText(true)</code> I get a strange result on 4.2.1 as you can see there:</p> <p><a href="https://stackoverflow.com/questions/13941270/android-4-2-on-nexus-7-canvas-drawtext-not-working-correctly">Android 4.2 on Nexus 7: canvas.drawText() not working correctly</a></p> <p><strong>EDIT:</strong></p> <p>This strange behaviour has been reported to the Android team: <a href="http://code.google.com/p/android/issues/detail?id=39755" rel="nofollow noreferrer">http://code.google.com/p/android/issues/detail?id=39755</a> but it's still not a "official" issue.</p> <p><strong>EDIT (2):</strong></p> <p>Some rumors claim that the problem is a textSize &lt; 1.0f...</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload