Android Monospace Doesn't Behave As A Fixed-pitch

- 1 answer

As you can see in the screenshot below the two different strings with the same length not drawn with the same width on the canvas. I'm using a monospaced typeface, so isn't it promised to be drawn with the same width? Is that because of the kerning?


enter image description here



This is a well-known kerning issue with monosapce font on Android. It looks like this is a quite old topic.

Some people have already faced this problem:

Android Monospace fonts aren't fixed width - 2013-06-11

Are Android monospace fonts actually fixed size? - 2016-06-22

Android monospace space ( ) width is different than character width - 2017-03-02

The issue also occurred in mobile web environment:

Font monospace Android 2.3 - 2013-07-11

where problem explained with missing glyph:


Option 1.:

Looking for an alternative fixed-width font might be the easiest way. Some helpful links to find one:

Option 2.:

You can override text drawing using Spans. This post may help you:

Option 3.:

You can modify the monospace font file to fix kerning. This online tool can be useful: