# Paint.FontMetrics

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# FontMetrics

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/android/graphics/Paint.FontMetrics "View this page in Java")  

```
open class FontMetrics
```

|---|--------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                           ||
| ↳ | [android.graphics.Paint.FontMetrics](https://developer.android.com/reference/kotlin/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                                                      ||
|---------------------------------------------------------------------------------------------------------------------------|---|
| [FontMetrics](https://developer.android.com/reference/kotlin/android/graphics/Paint.FontMetrics#FontMetrics())`()` <br /> |

|                                                                                                                                              Public methods                                                                                                                                              ||
|-----------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| open [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [equals](https://developer.android.com/reference/kotlin/android/graphics/Paint.FontMetrics#equals(kotlin.Any))`(`other:` `[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)?`)` <br /> |
| open [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)         | [hashCode](https://developer.android.com/reference/kotlin/android/graphics/Paint.FontMetrics#hashCode())`()` <br />                                                                                             |
| open [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)   | [toString](https://developer.android.com/reference/kotlin/android/graphics/Paint.FontMetrics#toString())`()` <br />                                                                                             |

|                                                                                                                                           Properties                                                                                                                                           ||
|--------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html) | [ascent](https://developer.android.com/reference/kotlin/android/graphics/Paint.FontMetrics#ascent:kotlin.Float) The recommended distance above the baseline for singled spaced text.                           |
| [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html) | [bottom](https://developer.android.com/reference/kotlin/android/graphics/Paint.FontMetrics#bottom:kotlin.Float) The maximum distance below the baseline for the lowest glyph in the font at a given text size. |
| [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html) | [descent](https://developer.android.com/reference/kotlin/android/graphics/Paint.FontMetrics#descent:kotlin.Float) The recommended distance below the baseline for singled spaced text.                         |
| [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html) | [leading](https://developer.android.com/reference/kotlin/android/graphics/Paint.FontMetrics#leading:kotlin.Float) The recommended additional space to add between lines of text.                               |
| [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html) | [top](https://developer.android.com/reference/kotlin/android/graphics/Paint.FontMetrics#top:kotlin.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](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun equals(other: Any?): Boolean
```

|                     Parameters                     ||
|-------|---------------------------------------------|
| `obj` | the reference object with which to compare. |

|                                                                            Return                                                                             ||
|------------------------------------------------------------------------------------|---------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | `true` if this object is the same as the obj argument; `false` otherwise. |

### hashCode

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun hashCode(): Int
```

|                                                     Return                                                     ||
|----------------------------------------------------------------------------|------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | a hash code value for this object. |

### toString

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun toString(): String
```

|                                                          Return                                                          ||
|----------------------------------------------------------------------------------|----------------------------------------|
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | a string representation of the object. |

## Properties

### ascent

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
var ascent: Float
```

The recommended distance above the baseline for singled spaced text.  

### bottom

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
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](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
var descent: Float
```

The recommended distance below the baseline for singled spaced text.  

### leading

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
var leading: Float
```

The recommended additional space to add between lines of text.  

### top

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
var top: Float
```

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