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 FontMetrics getFontMetrics() 

Source Link

Document

Allocates a new FontMetrics object, and then calls getFontMetrics(fm) with it, returning the object.

Usage

From source file:com.codename1.impl.android.AndroidImplementation.java

@Override
public int getFontDescent(Object nativeFont) {
    Paint font = (nativeFont == null ? this.defaultFont : (Paint) ((NativeFont) nativeFont).font);
    return Math.abs(Math.round(font.getFontMetrics().descent));
}