shape

abstract fun shape(face: Face, text: String, features: List<ShapeFeature> = emptyList(), direction: Direction? = null, script: Script? = null, language: String? = null): List<ShapeResult>(source)

Shapes the given text into a sequence of glyphs according to the specific font face and optional typographic attributes like writing direction and script.

Return

a list of shaped results, where each result includes information about the shaped glyphs, their positions, and any other relevant shaping data.

Parameters

face

the font face used for shaping the text. This determines the visual style and supported glyphs.

text

the input string to be shaped into glyphs.

direction

the optional writing direction for the text (e.g., left-to-right, right-to-left). If null, a default direction may be used based on the script or context.

script

the optional script used for shaping, specifying the writing system (e.g., Latin, Arabic, Chinese). If null, the script may be inferred from the text.

language

the optional language system used for shaping, specified as BCP 47 language tag.