Added in API level 1

FontMetrics


open class FontMetrics
kotlin.Any
   ↳ android.graphics.Paint.FontMetrics

Class that describes the various metrics for a font at a given text size. Remember, Y values increase going down, so those values will be positive, and values that measure distances going up will be negative. This class is returned by getFontMetrics().

Summary

Public constructors

Public methods
open Boolean
equals(other: Any?)

open Int

open String

Properties
Float

The recommended distance above the baseline for singled spaced text.

Float

The maximum distance below the baseline for the lowest glyph in the font at a given text size.

Float

The recommended distance below the baseline for singled spaced text.

Float

The recommended additional space to add between lines of text.

Float

The maximum distance above the baseline for the tallest glyph in the font at a given text size.

Public constructors

FontMetrics

FontMetrics()

Public methods

equals

Added in API level 1
open fun equals(other: Any?): Boolean
Parameters
obj the reference object with which to compare.
Return
Boolean true if this object is the same as the obj argument; false otherwise.

hashCode

Added in API level 1
open fun hashCode(): Int
Return
Int a hash code value for this object.

toString

Added in API level 1
open fun toString(): String
Return
String a string representation of the object.

Properties

ascent

Added in API level 1
var ascent: Float

The recommended distance above the baseline for singled spaced text.

bottom

Added in API level 1
var bottom: Float

The maximum distance below the baseline for the lowest glyph in the font at a given text size.

descent

Added in API level 1
var descent: Float

The recommended distance below the baseline for singled spaced text.

leading

Added in API level 1
var leading: Float

The recommended additional space to add between lines of text.

top

Added in API level 1
var top: Float

The maximum distance above the baseline for the tallest glyph in the font at a given text size.