# Paint.FontMetricsInt

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

# FontMetricsInt

*** ** * ** ***

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

```
open class FontMetricsInt
```

|---|--------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                 ||
| ↳ | [android.graphics.Paint.FontMetricsInt](https://developer.android.com/reference/kotlin/android/graphics/Paint.FontMetricsInt#) |

|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Known Direct Subclasses [BoringLayout.Metrics](https://developer.android.com/reference/kotlin/android/text/BoringLayout.Metrics.html#) |----------------------------------------------------------------------------------------------------------------|--------| | [BoringLayout.Metrics](https://developer.android.com/reference/kotlin/android/text/BoringLayout.Metrics.html#) | <br /> | |

Convenience method for callers that want to have FontMetrics values as integers.

## Summary

|                                                          Public constructors                                                          ||
|------------------------------------------------------------------------------------------------------------------------------------|---|
| [FontMetricsInt](https://developer.android.com/reference/kotlin/android/graphics/Paint.FontMetricsInt#FontMetricsInt())`()` <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.FontMetricsInt#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.FontMetricsInt#hashCode())`()` <br />                                                                                                                                                                                                                                                                                   |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)       | [set](https://developer.android.com/reference/kotlin/android/graphics/Paint.FontMetricsInt#set(android.graphics.Paint.FontMetrics))`(`fontMetrics:` `[Paint.FontMetrics](https://developer.android.com/reference/kotlin/android/graphics/Paint.FontMetrics)`)` Set values from[FontMetrics](https://developer.android.com/reference/kotlin/android/graphics/Paint.FontMetrics)with rounding accordingly. |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)       | [set](https://developer.android.com/reference/kotlin/android/graphics/Paint.FontMetricsInt#set(android.graphics.Paint.FontMetricsInt))`(`fontMetricsInt:` `[Paint.FontMetricsInt](https://developer.android.com/reference/kotlin/android/graphics/Paint.FontMetricsInt#)`)` Set values from[FontMetricsInt](https://developer.android.com/reference/kotlin/android/graphics/Paint.FontMetricsInt#).      |
| open[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)   | [toString](https://developer.android.com/reference/kotlin/android/graphics/Paint.FontMetricsInt#toString())`()` <br />                                                                                                                                                                                                                                                                                   |

|                                                                                                                                         Properties                                                                                                                                          ||
|----------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [ascent](https://developer.android.com/reference/kotlin/android/graphics/Paint.FontMetricsInt#ascent:kotlin.Int) The recommended distance above the baseline for singled spaced text.                           |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [bottom](https://developer.android.com/reference/kotlin/android/graphics/Paint.FontMetricsInt#bottom:kotlin.Int) The maximum distance below the baseline for the lowest glyph in the font at a given text size. |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [descent](https://developer.android.com/reference/kotlin/android/graphics/Paint.FontMetricsInt#descent:kotlin.Int) The recommended distance below the baseline for singled spaced text.                         |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [leading](https://developer.android.com/reference/kotlin/android/graphics/Paint.FontMetricsInt#leading:kotlin.Int) The recommended additional space to add between lines of text.                               |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [top](https://developer.android.com/reference/kotlin/android/graphics/Paint.FontMetricsInt#top:kotlin.Int) The maximum distance above the baseline for the tallest glyph in the font at a given text size.      |

## Public constructors

### FontMetricsInt

```
FontMetricsInt()
```

## 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. |

### set

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

```
open fun set(fontMetrics: Paint.FontMetrics): Unit
```

Set values from[FontMetrics](https://developer.android.com/reference/kotlin/android/graphics/Paint.FontMetrics)with rounding accordingly.

|                                                                            Parameters                                                                             ||
|---------------|----------------------------------------------------------------------------------------------------------------------------------------------------|
| `fontMetrics` | [Paint.FontMetrics](https://developer.android.com/reference/kotlin/android/graphics/Paint.FontMetrics):a font metrics. This value cannot be`null`. |

### set

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

```
open fun set(fontMetricsInt: Paint.FontMetricsInt): Unit
```

Set values from[FontMetricsInt](https://developer.android.com/reference/kotlin/android/graphics/Paint.FontMetricsInt#).

|                                                                                 Parameters                                                                                  ||
|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|
| `fontMetricsInt` | [Paint.FontMetricsInt](https://developer.android.com/reference/kotlin/android/graphics/Paint.FontMetricsInt#):a font metrics. This value cannot be`null`. |

### 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: Int
```

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: Int
```

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: Int
```

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: Int
```

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: Int
```

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