Java tutorial
//package com.java2s; //License from project: Open Source License import android.graphics.Paint; import android.graphics.Paint.FontMetrics; public class Main { public static float getYOfDrawText(Paint p, float centerY) { FontMetrics metrics = p.getFontMetrics(); return centerY - (metrics.top + (metrics.bottom - metrics.top) / 2); } }