PTShapedText

@interface PTShapedText : NSObject

The class ShapedText. A sequence of positioned glyphs – the visual representation of a given text string

  • 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

    Objective-C

    - (double)GetScale;

    Swift

    func getScale() -> Double

    Return Value

    returns the scaling factor for the glyph positions.

  • 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

    Objective-C

    - (PTShapingStatus)GetShapingStatus;

    Swift

    func getShapingStatus() -> PTShapingStatus

    Return Value

    .

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

    Declaration

    Objective-C

    - (PTShapingFailureReason)GetFailureReason;

    Swift

    func getFailureReason() -> PTShapingFailureReason

    Return Value

    .

  • The original source text string.

    Declaration

    Objective-C

    - (NSString *)GetText;

    Swift

    func getText() -> String!

    Return Value

    returns the source text string.

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

    Declaration

    Objective-C

    - (int)GetNumGlyphs;

    Swift

    func getNumGlyphs() -> Int32

    Return Value

    returns the number of utf32 codepoints in this shaped text.

  • 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

    Objective-C

    - (unsigned int)GetGlyph:(unsigned int)index;

    Swift

    func getGlyph(_ index: UInt32) -> UInt32

    Parameters

    index

    – the index of the glyph to be retrieved. Must be less than GetNumGlyphs().

    Return Value

    returns the glyph ID for the indicated place in the shaped result.

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

    Declaration

    Objective-C

    - (double)GetGlyphXPos:(unsigned int)index;

    Swift

    func getGlyphXPos(_ index: UInt32) -> Double

    Parameters

    index

    – the index of the glyph position to be retrieved. Must be less than GetNumGlyphs().

    Return Value

    returns the X position for the glyph at the specified index.

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

    Declaration

    Objective-C

    - (double)GetGlyphYPos:(unsigned int)index;

    Swift

    func getGlyphYPos(_ index: UInt32) -> Double

    Parameters

    index

    – the index of the glyph position to be retrieved. Must be less than GetNumGlyphs().

    Return Value

    returns the Y position for the glyph at the specified index.

  • Undocumented

    Declaration

    Objective-C

    - (instancetype)init;

    Swift

    init!()