# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Methods | Inherited Methods

# TextRunShaper

`public class TextRunShaper`
`extends Object` ``

java.lang.Object
↳ | android.graphics.text.TextRunShaper

Provides conversion from a text into glyph array. Text shaping is a preprocess for drawing text into canvas with glyphs. The glyph is a most primitive unit of the text drawing, consist of glyph identifier in the font file and its position and style. You can draw the shape result to Canvas by calling Canvas#drawGlyphs. For most of the use cases, `TextShaper` will provide text shaping functionalities needed. `TextRunShaper` is a lower level API that is used by `TextShaper`.

See also:

- `shapeTextRun(CharSequence, int, int, int, int, float, float, boolean, Paint)`
- `shapeTextRun(char[], int, int, int, int, float, float, boolean, Paint)`
- `TextShaper.shapeText(CharSequence, int, int, TextDirectionHeuristic, TextPaint, TextShaper.GlyphsConsumer)`

## Summary

### Public methods
`static PositionedGlyphs` | `shapeTextRun(CharSequence text, int start, int count, int contextStart, int contextCount, float xOffset, float yOffset, boolean isRtl, Paint paint)` Shape non-styled text.
`static PositionedGlyphs` | `shapeTextRun(char[] text, int start, int count, int contextStart, int contextCount, float xOffset, float yOffset, boolean isRtl, Paint paint)` Shape non-styled text.

### Inherited methods
From class `java.lang.Object`
`Object` | `clone()` Creates and returns a copy of this object.
`boolean` | `equals(Object obj)` Indicates whether some other object is "equal to" this one.
`void` | `finalize()` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
`final Class<?>` | `getClass()` Returns the runtime class of this `Object`.
`int` | `hashCode()` Returns a hash code value for the object.
`final void` | `notify()` Wakes up a single thread that is waiting on this object's monitor.
`final void` | `notifyAll()` Wakes up all threads that are waiting on this object's monitor.
`String` | `toString()` Returns a string representation of the object.
`final void` | `wait(long timeout, int nanos)` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
`final void` | `wait(long timeout)` Causes the current thread to wait until either another thread invokes the `notify()` method or the `notifyAll()` method for this object, or a specified amount of time has elapsed.
`final void` | `wait()` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object.

## Public methods

### shapeTextRun

    public static PositionedGlyphs shapeTextRun (CharSequence text,
                    int start,
                    int count,
                    int contextStart,
                    int contextCount,
                    float xOffset,
                    float yOffset,
                    boolean isRtl,
                    Paint paint)

Shape non-styled text. This function shapes the text of the given range under the context of given context range. Some script, e.g. Arabic or Devanagari, changes letter shape based on its location or surrounding characters.

Parameters
`text` | `CharSequence`: a text buffer to be shaped. Any styled spans stored in this text are ignored. This value cannot be `null`.
`start` | `int`: a start index of shaping target in the buffer.
`count` | `int`: a length of shaping target in the buffer.
`contextStart` | `int`: a start index of context used for shaping in the buffer.
`contextCount` | `int`: a length of context used for shaping in the buffer.
`xOffset` | `float`: an additional amount of x offset of the result glyphs.
`yOffset` | `float`: an additional amount of y offset of the result glyphs.
`isRtl` | `boolean`: true if this text is shaped for RTL direction, false otherwise.
`paint` | `Paint`: a paint used for shaping text. This value cannot be `null`.

Returns
`PositionedGlyphs` | a shape result This value cannot be `null`.

### shapeTextRun

    public static PositionedGlyphs shapeTextRun (char[] text,
                    int start,
                    int count,
                    int contextStart,
                    int contextCount,
                    float xOffset,
                    float yOffset,
                    boolean isRtl,
                    Paint paint)

Shape non-styled text. This function shapes the text of the given range under the context of given context range. Some script, e.g. Arabic or Devanagari, changes letter shape based on its location or surrounding characters.

Parameters
`text` | `char`: a text buffer to be shaped This value cannot be `null`.
`start` | `int`: a start index of shaping target in the buffer.
`count` | `int`: a length of shaping target in the buffer.
`contextStart` | `int`: a start index of context used for shaping in the buffer.
`contextCount` | `int`: a length of context used for shaping in the buffer.
`xOffset` | `float`: an additional amount of x offset of the result glyphs.
`yOffset` | `float`: an additional amount of y offset of the result glyphs.
`isRtl` | `boolean`: true if this text is shaped for RTL direction, false otherwise.
`paint` | `Paint`: a paint used for shaping text. This value cannot be `null`.

Returns
`PositionedGlyphs` | a shape result. This value cannot be `null`.

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*