Java tutorial
//package com.java2s; import android.graphics.Paint; public class Main { public static int measureTextHeight(int textsize) { Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); paint.setTextSize(textsize); Paint.FontMetrics metrics = paint.getFontMetrics(); return (int) Math.ceil(metrics.descent - metrics.ascent); } }