Stay organized with collections
Save and categorize content based on your preferences.
FontMetricsInt
open class FontMetricsInt
Convenience method for callers that want to have FontMetrics values as integers.
Summary
Properties |
Int |
The recommended distance above the baseline for singled spaced text.
|
Int |
The maximum distance below the baseline for the lowest glyph in the font at a given text size.
|
Int |
The recommended distance below the baseline for singled spaced text.
|
Int |
The recommended additional space to add between lines of text.
|
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
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
open fun hashCode(): Int
Return |
Int |
a hash code value for this object. |
toString
open fun toString(): String
Return |
String |
a string representation of the object. |
Properties
ascent
var ascent: Int
The recommended distance above the baseline for singled spaced text.
bottom
var bottom: Int
The maximum distance below the baseline for the lowest glyph in the font at a given text size.
descent
var descent: Int
The recommended distance below the baseline for singled spaced text.
leading
var leading: Int
The recommended additional space to add between lines of text.
top
var top: Int
The maximum distance above the baseline for the tallest glyph in the font at a given text size.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# Paint.FontMetricsInt\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nFontMetricsInt\n==============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/graphics/Paint.FontMetricsInt \"View this page in Java\") \n\n```\nopen class FontMetricsInt\n```\n\n|---|--------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.graphics.Paint.FontMetricsInt](#) |\n\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Direct Subclasses [BoringLayout.Metrics](../text/BoringLayout.Metrics.html#) |------------------------------------------------------------|--------| | [BoringLayout.Metrics](../text/BoringLayout.Metrics.html#) | \u003cbr /\u003e | |\n\nConvenience method for callers that want to have FontMetrics values as integers.\n\nSummary\n-------\n\n| Public constructors ||\n|------------------------------------------------|---|\n| [FontMetricsInt](#FontMetricsInt())`()` \u003cbr /\u003e |\n\n| Public methods ||\n|-----------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [equals](#equals(kotlin.Any))`(`other:` `[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)?`)` \u003cbr /\u003e |\n| open [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [hashCode](#hashCode())`()` \u003cbr /\u003e |\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [set](#set(android.graphics.Paint.FontMetrics))`(`fontMetrics:` `[Paint.FontMetrics](/reference/kotlin/android/graphics/Paint.FontMetrics)`)` Set values from [FontMetrics](/reference/kotlin/android/graphics/Paint.FontMetrics) with rounding accordingly. |\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [set](#set(android.graphics.Paint.FontMetricsInt))`(`fontMetricsInt:` `[Paint.FontMetricsInt](#)`)` Set values from [FontMetricsInt](#). |\n| open [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [toString](#toString())`()` \u003cbr /\u003e |\n\n| Properties ||\n|----------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [ascent](#ascent:kotlin.Int) The recommended distance above the baseline for singled spaced text. |\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [bottom](#bottom:kotlin.Int) The maximum distance below the baseline for the lowest glyph in the font at a given text size. |\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [descent](#descent:kotlin.Int) The recommended distance below the baseline for singled spaced text. |\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [leading](#leading:kotlin.Int) The recommended additional space to add between lines of text. |\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [top](#top:kotlin.Int) The maximum distance above the baseline for the tallest glyph in the font at a given text size. |\n\nPublic constructors\n-------------------\n\n### FontMetricsInt\n\n```\nFontMetricsInt()\n```\n\nPublic methods\n--------------\n\n### equals\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun equals(other: Any?): Boolean\n```\n\n| Parameters ||\n|-------|---------------------------------------------|\n| `obj` | the reference object with which to compare. |\n\n| Return ||\n|------------------------------------------------------------------------------------|---------------------------------------------------------------------------|\n| [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. |\n\n### hashCode\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun hashCode(): Int\n```\n\n| Return ||\n|----------------------------------------------------------------------------|------------------------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | a hash code value for this object. |\n\n### set\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun set(fontMetrics: Paint.FontMetrics): Unit\n```\n\nSet values from [FontMetrics](/reference/kotlin/android/graphics/Paint.FontMetrics) with rounding accordingly.\n\n| Parameters ||\n|---------------|-------------------------------------------------------------------------------------------------------------------------|\n| `fontMetrics` | [Paint.FontMetrics](/reference/kotlin/android/graphics/Paint.FontMetrics): a font metrics. This value cannot be `null`. |\n\n### set\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun set(fontMetricsInt: Paint.FontMetricsInt): Unit\n```\n\nSet values from [FontMetricsInt](#).\n\n| Parameters ||\n|------------------|-------------------------------------------------------------------------|\n| `fontMetricsInt` | [Paint.FontMetricsInt](#): a font metrics. This value cannot be `null`. |\n\n### toString\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun toString(): String\n```\n\n| Return ||\n|----------------------------------------------------------------------------------|----------------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | a string representation of the object. |\n\nProperties\n----------\n\n### ascent\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nvar ascent: Int\n```\n\nThe recommended distance above the baseline for singled spaced text. \n\n### bottom\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nvar bottom: Int\n```\n\nThe maximum distance below the baseline for the lowest glyph in the font at a given text size. \n\n### descent\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nvar descent: Int\n```\n\nThe recommended distance below the baseline for singled spaced text. \n\n### leading\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nvar leading: Int\n```\n\nThe recommended additional space to add between lines of text. \n\n### top\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nvar top: Int\n```\n\nThe maximum distance above the baseline for the tallest glyph in the font at a given text size."]]