Getting rendered text height, which is equivalent to rendered text width using paint.measureText
<p>I have the following code to draw text.</p>

<pre><code>protected void onDraw(Canvas canvas) {
    super.onDraw(canvas);

    Paint paint = new Paint();
    paint.setTextSize(400);
    paint.setColor(Color.WHITE);
    paint.setAntiAlias(true);
    paint.setTextAlign(Align.LEFT);
    paint.setStyle(Style.FILL);
    String text = "698";
    Rect bounds = new Rect();
    paint.getTextBounds(text, 0, text.length(), bounds);

    int textWidth = bounds.width();        
    int textHeight = bounds.height();

    Bitmap originalBitmap = Bitmap.createBitmap(textWidth,
            textHeight, Bitmap.Config.ARGB_8888);
    Canvas singleUseCanvas = new Canvas(originalBitmap); 
    singleUseCanvas.drawColor(Color.BLUE);
    singleUseCanvas.drawText(text, 0, textHeight, paint);
    canvas.drawBitmap(originalBitmap, 0, 0, null);
}
</code></pre>

<p>I am getting undesired outcome, which its right and bottom sides are being cropped.</p>

<p><img src="http://i.stack.imgur.com/gZ6Bv.jpg" alt="enter image description here"></p>

<p>I avoid right side cropping, by using </p>

<pre><code>float textWidth = paint.measureText(text);
Bitmap originalBitmap = Bitmap.createBitmap((int)(textWidth + 0.5),
                textHeight, Bitmap.Config.ARGB_8888);
</code></pre>

<p>I am getting the following improvement</p>

<p><img src="http://i.stack.imgur.com/MlPMn.jpg" alt="enter image description here"></p>

<p>Yet. My bottom still being cropped. May I know what is the correct way to obtained rendered text height, which is analogy to rendered text width using paint.measureText?</p>
