Stay organized with collections
Save and categorize content based on your preferences.
TextShaper.GlyphsConsumer
public
static
interface
TextShaper.GlyphsConsumer
android.text.TextShaper.GlyphsConsumer
|
A consumer interface for accepting text shape result.
Summary
Public methods
accept
public abstract void accept (int start,
int count,
PositionedGlyphs glyphs,
TextPaint paint)
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.
[[["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,["# TextShaper.GlyphsConsumer\n\nAdded in [API level 31](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nTextShaper.GlyphsConsumer\n=========================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/text/TextShaper.GlyphsConsumer \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nTextShaper.GlyphsConsumer\n`\n\n\n`\n\n\n`\n\n|----------------------------------------|\n| android.text.TextShaper.GlyphsConsumer |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nA consumer interface for accepting text shape result.\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[accept](/reference/android/text/TextShaper.GlyphsConsumer#accept(int,%20int,%20android.graphics.text.PositionedGlyphs,%20android.text.TextPaint))`(int start, int count, `[PositionedGlyphs](/reference/android/graphics/text/PositionedGlyphs)` glyphs, `[TextPaint](/reference/android/text/TextPaint)` paint) ` Accept text shape result. |\n\nPublic methods\n--------------\n\n### accept\n\nAdded in [API level 31](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void accept (int start, \n int count, \n PositionedGlyphs glyphs, \n TextPaint paint)\n```\n\nAccept text shape result.\n\nThe implementation must not keep reference of paint since it will be mutated for the\nsubsequent styles. Also, for saving heap size, keep only necessary members in the\n[TextPaint](/reference/android/text/TextPaint) instead of copying [TextPaint](/reference/android/text/TextPaint) object.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------|------------------------------------------------------------------------------------|\n| `start` | `int`: The start index of the shaped text. Value is 0 or greater \u003cbr /\u003e |\n| `count` | `int`: The length of the shaped text. Value is 0 or greater \u003cbr /\u003e |\n| `glyphs` | `PositionedGlyphs`: The shape result. This value cannot be `null`. \u003cbr /\u003e |\n| `paint` | `TextPaint`: The paint to be used for drawing. This value cannot be `null`. \u003cbr /\u003e |"]]