Stay organized with collections
Save and categorize content based on your preferences.
GlyphsConsumer
interface GlyphsConsumer
A consumer interface for accepting text shape result.
Summary
Public methods |
abstract Unit |
Accept text shape result.
|
Public methods
accept
abstract fun accept(
start: Int,
count: Int,
glyphs: PositionedGlyphs,
paint: TextPaint
): Unit
Accept text shape result. The implementation must not keep reference of paint since it will be mutated for the subsequent styles. Also, for saving heap size, keep only necessary members in the TextPaint
instead of copying TextPaint
object.
Parameters |
start |
Int: The start index of the shaped text. Value is 0 or greater |
count |
Int: The length of the shaped text. Value is 0 or greater |
glyphs |
PositionedGlyphs: The shape result. This value cannot be null . |
paint |
TextPaint: The paint to be used for drawing. This value cannot be null . |
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.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# TextShaper.GlyphsConsumer\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nGlyphsConsumer\n==============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/text/TextShaper.GlyphsConsumer \"View this page in Java\") \n\n```\ninterface GlyphsConsumer\n```\n\n|---------------------------------------------|\n| [android.text.TextShaper.GlyphsConsumer](#) |\n\nA consumer interface for accepting text shape result.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [accept](#accept(kotlin.Int,%20kotlin.Int,%20android.graphics.text.PositionedGlyphs,%20android.text.TextPaint))`(`start:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `count:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `glyphs:` `[PositionedGlyphs](../graphics/text/PositionedGlyphs.html#)`, `paint:` `[TextPaint](/reference/kotlin/android/text/TextPaint)`)` Accept text shape result. |\n\nPublic methods\n--------------\n\n### accept\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun accept(\n start: Int, \n count: Int, \n glyphs: PositionedGlyphs, \n paint: TextPaint\n): Unit\n```\n\nAccept text shape result. The implementation must not keep reference of paint since it will be mutated for the subsequent styles. Also, for saving heap size, keep only necessary members in the [TextPaint](/reference/kotlin/android/text/TextPaint) instead of copying [TextPaint](/reference/kotlin/android/text/TextPaint) object.\n\n| Parameters ||\n|----------|---------------------------------------------------------------------------------------------------------------------------------------|\n| `start` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The start index of the shaped text. Value is 0 or greater |\n| `count` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The length of the shaped text. Value is 0 or greater |\n| `glyphs` | [PositionedGlyphs](../graphics/text/PositionedGlyphs.html#): The shape result. This value cannot be `null`. |\n| `paint` | [TextPaint](/reference/kotlin/android/text/TextPaint): The paint to be used for drawing. This value cannot be `null`. |"]]