Android examples for User Interface:TextView Font
get TextView Font height
//package com.java2s; import android.graphics.Paint; import android.graphics.Paint.FontMetrics; import android.widget.TextView; public class Main { /**/*from w ww .java2s.c om*/ * get Font height * * @param view * @return */ public static int getFontHeight(TextView view) { Paint paint = new Paint(); paint.setTextSize(view.getTextSize()); FontMetrics fm = paint.getFontMetrics(); return (int) (Math.ceil(fm.descent - fm.ascent)); } }