Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/android/graphics/text/PositionedGlyphs#constants) \| [Methods](https://developer.android.com/reference/android/graphics/text/PositionedGlyphs#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/graphics/text/PositionedGlyphs#inhmethods)

# PositionedGlyphs

*** ** * ** ***

` public final class PositionedGlyphs `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.graphics.text.PositionedGlyphs |

<br />

*** ** * ** ***

Text shaping result object for single style text. You can get text shaping result by `https://developer.android.com/reference/android/graphics/text/TextRunShaper#shapeTextRun(char[],%20int,%20int,%20int,%20int,%20float,%20float,%20boolean,%20android.graphics.Paint)` and `https://developer.android.com/reference/android/graphics/text/TextRunShaper#shapeTextRun(java.lang.CharSequence,%20int,%20int,%20int,%20int,%20float,%20float,%20boolean,%20android.graphics.Paint)`.
**See also:**

- `https://developer.android.com/reference/android/graphics/text/TextRunShaper#shapeTextRun(char[],%20int,%20int,%20int,%20int,%20float,%20float,%20boolean,%20android.graphics.Paint)`
- `https://developer.android.com/reference/android/graphics/text/TextRunShaper#shapeTextRun(java.lang.CharSequence,%20int,%20int,%20int,%20int,%20float,%20float,%20boolean,%20android.graphics.Paint)`

## Summary

| ### Constants ||
|---|---|
| `float` | `https://developer.android.com/reference/android/graphics/text/PositionedGlyphs#NO_OVERRIDE` A special value returned by `https://developer.android.com/reference/android/graphics/text/PositionedGlyphs#getWeightOverride(int)` and `https://developer.android.com/reference/android/graphics/text/PositionedGlyphs#getItalicOverride(int)` that indicates no font variation setting is overridden. |

| ### Public methods ||
|---|---|
| ` boolean` | ` https://developer.android.com/reference/android/graphics/text/PositionedGlyphs#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object o) ` Indicates whether some other object is "equal to" this one. |
| ` float` | ` https://developer.android.com/reference/android/graphics/text/PositionedGlyphs#getAdvance()() ` Returns the total amount of advance consumed by this positioned glyphs. |
| ` float` | ` https://developer.android.com/reference/android/graphics/text/PositionedGlyphs#getAscent()() ` Effective ascent value of this positioned glyphs. |
| ` float` | ` https://developer.android.com/reference/android/graphics/text/PositionedGlyphs#getDescent()() ` Effective descent value of this positioned glyphs. |
| ` boolean` | ` https://developer.android.com/reference/android/graphics/text/PositionedGlyphs#getFakeBold(int)(int index) ` Returns true if the fake bold option used for drawing, otherwise false. |
| ` boolean` | ` https://developer.android.com/reference/android/graphics/text/PositionedGlyphs#getFakeItalic(int)(int index) ` Returns true if the fake italic option used for drawing, otherwise false. |
| ` https://developer.android.com/reference/android/graphics/fonts/Font` | ` https://developer.android.com/reference/android/graphics/text/PositionedGlyphs#getFont(int)(int index) ` Returns the font object used for drawing the glyph at the given index. |
| ` int` | ` https://developer.android.com/reference/android/graphics/text/PositionedGlyphs#getGlyphId(int)(int index) ` Returns the glyph ID used for drawing the glyph at the given index. |
| ` float` | ` https://developer.android.com/reference/android/graphics/text/PositionedGlyphs#getGlyphX(int)(int index) ` Returns the x coordinate of the glyph position at the given index. |
| ` float` | ` https://developer.android.com/reference/android/graphics/text/PositionedGlyphs#getGlyphY(int)(int index) ` Returns the y coordinate of the glyph position at the given index. |
| ` float` | ` https://developer.android.com/reference/android/graphics/text/PositionedGlyphs#getItalicOverride(int)(int index) ` Returns overridden italic value if the font is variable font and \`ital\` value is overridden for drawing. |
| ` float` | ` https://developer.android.com/reference/android/graphics/text/PositionedGlyphs#getOffsetX()() ` Returns the amount of X offset added to glyph position. |
| ` float` | ` https://developer.android.com/reference/android/graphics/text/PositionedGlyphs#getOffsetY()() ` Returns the amount of Y offset added to glyph position. |
| ` float` | ` https://developer.android.com/reference/android/graphics/text/PositionedGlyphs#getWeightOverride(int)(int index) ` Returns overridden weight value if the font is variable font and \`wght\` value is overridden for drawing. |
| ` int` | ` https://developer.android.com/reference/android/graphics/text/PositionedGlyphs#glyphCount()() ` Returns the number of glyphs stored. |
| ` int` | ` https://developer.android.com/reference/android/graphics/text/PositionedGlyphs#hashCode()() ` Returns a hash code value for the object. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/graphics/text/PositionedGlyphs#toString()() ` Returns a string representation of the object. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Constants

### NO_OVERRIDE

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final float NO_OVERRIDE
```

A special value returned by `https://developer.android.com/reference/android/graphics/text/PositionedGlyphs#getWeightOverride(int)` and `https://developer.android.com/reference/android/graphics/text/PositionedGlyphs#getItalicOverride(int)` that indicates no font variation setting is overridden.

<br />

Constant Value: 1.4E-45

## Public methods

### equals

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean equals (Object o)
```

Indicates whether some other object is "equal to" this one.

The `equals` method implements an equivalence relation on non-null object references:

- It is *reflexive*: for any non-null reference value `x`, `x.equals(x)` should return `true`.
- It is *symmetric*: for any non-null reference values `x` and `y`, `x.equals(y)` should return `true` if and only if `y.equals(x)` returns `true`.
- It is *transitive*: for any non-null reference values `x`, `y`, and `z`, if `x.equals(y)` returns `true` and `y.equals(z)` returns `true`, then `x.equals(z)` should return `true`.
- It is *consistent*: for any non-null reference values `x` and `y`, multiple invocations of `x.equals(y)` consistently return `true` or consistently return `false`, provided no information used in `equals` comparisons on the objects is modified.
- For any non-null reference value `x`, `x.equals(null)` should return `false`.

An equivalence relation partitions the elements it operates on into *equivalence classes*; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

<br />

| Parameters ||
|---|---|
| `o` | `Object`: the reference object with which to compare. <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if this object is the same as the obj argument; `false` otherwise. <br /> |

### getAdvance

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float getAdvance ()
```

Returns the total amount of advance consumed by this positioned glyphs. The advance is an amount of width consumed by the glyph. The total amount of advance is a total amount of advance consumed by this series of glyphs. In other words, if another glyph is placed next to this series of glyphs, it's X offset should be shifted this amount of width.

<br />

| Returns ||
|---|---|
| `float` | total amount of advance <br /> |

### getAscent

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float getAscent ()
```

Effective ascent value of this positioned glyphs. If two or more font files are used in this series of glyphs, the effective ascent will be the minimum ascent value across the all font files.

<br />

| Returns ||
|---|---|
| `float` | effective ascent value <br /> |

### getDescent

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float getDescent ()
```

Effective descent value of this positioned glyphs. If two or more font files are used in this series of glyphs, the effective descent will be the maximum descent value across the all font files.

<br />

| Returns ||
|---|---|
| `float` | effective descent value <br /> |

### getFakeBold

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean getFakeBold (int index)
```

Returns true if the fake bold option used for drawing, otherwise false.

<br />

| Parameters ||
|---|---|
| `index` | `int`: the glyph index. Value is 0 or greater <br /> |

| Returns ||
|---|---|
| `boolean` | true if the fake bold option is on, otherwise off. <br /> |

### getFakeItalic

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean getFakeItalic (int index)
```

Returns true if the fake italic option used for drawing, otherwise false.

<br />

| Parameters ||
|---|---|
| `index` | `int`: the glyph index. Value is 0 or greater <br /> |

| Returns ||
|---|---|
| `boolean` | true if the fake italic option is on, otherwise off. <br /> |

### getFont

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Font getFont (int index)
```

Returns the font object used for drawing the glyph at the given index.

<br />

| Parameters ||
|---|---|
| `index` | `int`: the glyph index. Value is 0 or greater <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/fonts/Font` | the font object used for drawing the glyph at the given index. This value cannot be `null`. <br /> |

### getGlyphId

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getGlyphId (int index)
```

Returns the glyph ID used for drawing the glyph at the given index.

<br />

| Parameters ||
|---|---|
| `index` | `int`: the glyph index. Value is 0 or greater <br /> |

| Returns ||
|---|---|
| `int` | A glyph ID of the font. Value is 0 or greater <br /> |

### getGlyphX

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float getGlyphX (int index)
```

Returns the x coordinate of the glyph position at the given index.

<br />

| Parameters ||
|---|---|
| `index` | `int`: the glyph index. Value is 0 or greater <br /> |

| Returns ||
|---|---|
| `float` | A X offset in pixels <br /> |

### getGlyphY

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float getGlyphY (int index)
```

Returns the y coordinate of the glyph position at the given index.

<br />

| Parameters ||
|---|---|
| `index` | `int`: the glyph index. Value is 0 or greater <br /> |

| Returns ||
|---|---|
| `float` | A Y offset in pixels. <br /> |

### getItalicOverride

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float getItalicOverride (int index)
```

Returns overridden italic value if the font is variable font and \`ital\` value is overridden for drawing. Otherwise returns `https://developer.android.com/reference/android/graphics/text/PositionedGlyphs#NO_OVERRIDE`.

<br />

| Parameters ||
|---|---|
| `index` | `int`: the glyph index. Value is 0 or greater <br /> |

| Returns ||
|---|---|
| `float` | overridden weight value or `https://developer.android.com/reference/android/graphics/text/PositionedGlyphs#NO_OVERRIDE`. <br /> |

### getOffsetX

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float getOffsetX ()
```

Returns the amount of X offset added to glyph position.

<br />

| Returns ||
|---|---|
| `float` | The X offset added to glyph position. <br /> |

### getOffsetY

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float getOffsetY ()
```

Returns the amount of Y offset added to glyph position.

<br />

| Returns ||
|---|---|
| `float` | The Y offset added to glyph position. <br /> |

### getWeightOverride

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float getWeightOverride (int index)
```

Returns overridden weight value if the font is variable font and \`wght\` value is overridden for drawing. Otherwise returns `https://developer.android.com/reference/android/graphics/text/PositionedGlyphs#NO_OVERRIDE`.

<br />

| Parameters ||
|---|---|
| `index` | `int`: the glyph index. Value is 0 or greater <br /> |

| Returns ||
|---|---|
| `float` | overridden weight value or `https://developer.android.com/reference/android/graphics/text/PositionedGlyphs#NO_OVERRIDE`. <br /> |

### glyphCount

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int glyphCount ()
```

Returns the number of glyphs stored.

<br />

| Returns ||
|---|---|
| `int` | the number of glyphs. Value is 0 or greater <br /> |

### hashCode

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int hashCode ()
```

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by `https://developer.android.com/reference/java/util/HashMap`.

The general contract of `hashCode` is:

- Whenever it is invoked on the same object more than once during an execution of a Java application, the `hashCode` method must consistently return the same integer, provided no information used in `equals` comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
- If two objects are equal according to the `https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)` method, then calling the `hashCode` method on each of the two objects must produce the same integer result.
- It is *not* required that if two objects are unequal according to the `https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)` method, then calling the `hashCode` method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.

<br />

<br />

| Returns ||
|---|---|
| `int` | a hash code value for this object. <br /> |

### toString

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String toString ()
```

Returns a string representation of the object.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | a string representation of the object. <br /> |