Android Monospace fonts aren't fixed width
I'm writing a custom View for a timer, but I can't get a properly fixed-width font for the numbers in the middle. Here's the relevant code (from two different methods): mTextPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG); mTextPaint.setTypeface(Typeface.create(Typeface.MONOSPACE, Typeface.NORMAL)); // Get rectangle that is the size of the text mTextPaint.getTextBounds( getTimeText(), 0, getTimeText().length(), mTextBounds); // X and Y coordinates of text float mTextPosX = (width / 2) - (mTextBounds.width() / 2); float mTextPosY = (height / 2) + (mTextBounds.height() / 2); // Draw text canvas