Example usage for android.graphics Paint getFontMetrics

List of usage examples for android.graphics Paint getFontMetrics

Introduction

In this page you can find the example usage for android.graphics Paint getFontMetrics.

Prototype

public float getFontMetrics(FontMetrics metrics) 

Source Link

Document

Return the font's recommended interline spacing, given the Paint's settings for typeface, textSize, etc.

Usage

From source file:Main.java

public static float getLineHeight(Paint paint, Paint.FontMetrics fontMetrics) {
    paint.getFontMetrics(fontMetrics);
    return fontMetrics.descent - fontMetrics.ascent;
}