Show / Hide Table of Contents

# Class ShapedText

A sequence of positioned glyphs -- the visual representation of a given text string

##### Inheritance

object
ShapedText

##### Implements

IDisposable

##### Inherited Members

object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()

###### Namespace: pdftron.PDF

###### Assembly: PDFNet.dll

##### Syntax

    public sealed class ShapedText : IDisposable

### Methods

#### Dispose()

##### Declaration

    public override sealed void Dispose()

#### Dispose(bool)

##### Declaration

    [HandleProcessCorruptedStateExceptions]
    protected void Dispose(bool A_0)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | A_0 |

#### ~ShapedText()

##### Declaration

    protected ~ShapedText()

#### GetFailureReason()

In the case where GetShapingStatus() returns something other than FullShaping, this method will return a more detailed reason behind the failure.

##### Declaration

    public ShapedText.FailureReason GetFailureReason()

##### Returns

Type | Description
--- | ---
ShapedText.FailureReason |

#### GetGlyph(int)

Get the glyph ID at the indicated place in the shaped sequence. This number is specific to the font file used to generate the shaping results, and does not always have a clean mapping to a particular Unicode codepoint in the original string.

##### Declaration

    public int GetGlyph(int index)

##### Parameters

Type | Name | Description
--- | --- | ---
int | index | the index of the glyph to be retrieved. Must be less than GetNumGlyphs()

##### Returns

Type | Description
--- | ---
int | returns the glyph ID for the indicated place in the shaped result

#### GetGlyphXPos(int)

The X position of the glyph at the requested index. This number has been scaled by GetScale().

##### Declaration

    public double GetGlyphXPos(int index)

##### Parameters

Type | Name | Description
--- | --- | ---
int | index | the index of the glyph position to be retrieved. Must be less than GetNumGlyphs()

##### Returns

Type | Description
--- | ---
double | returns the X position for the glyph at the specified index

#### GetGlyphYPos(int)

The Y position of the glyph at the requested index. This number has been scaled by GetScale().

##### Declaration

    public double GetGlyphYPos(int index)

##### Parameters

Type | Name | Description
--- | --- | ---
int | index | the index of the glyph position to be retrieved. Must be less than GetNumGlyphs()

##### Returns

Type | Description
--- | ---
double | returns the Y position for the glyph at the specified index

#### GetNumGlyphs()

Number of glyphs present in the shaped text. Might be different from the .

##### Declaration

    public int GetNumGlyphs()

##### Returns

Type | Description
--- | ---
int | returns the number of utf32 codepoints in this shaped text

#### GetScale()

Scaling factor of this shaped text relative to the em size. A scaling factor of 1 means that all units are relative to the em size. PDF scaling is typically 1000 units per em.

##### Declaration

    public double GetScale()

##### Returns

Type | Description
--- | ---
double | returns the scaling factor for the glyph positions

#### GetShapingStatus()

Get the state of the shaping operation. Even if the shaping did not fully succeed, this object can be added to an elementbuilder, and will fallback to placing unshped text. See GetFailureReason() in the case this method returns something other than FullShaping.

##### Declaration

    public ShapedText.ShapingStatus GetShapingStatus()

##### Returns

Type | Description
--- | ---
ShapedText.ShapingStatus |

#### GetText()

The original source text string.

##### Declaration

    public string GetText()

##### Returns

Type | Description
--- | ---
string | returns the source text string

### Implements

IDisposable