Loading...
Searching...
No Matches
pdftron::PDF::ShapedText Class Reference

`#include <ShapedText.h>`

## Public Types
enum | ShapingStatus { e_FullShaping = 0 , e_PartialShaping = 1 , e_NoShaping = 2 }
enum | FailureReason { e_NoFailure = 0 , e_UnsupportedFontType = 1 , e_NotIndexEncoded = 2 , e_FontDataNotFound = 3 }

## Public Member Functions
| ShapedText ()
| ShapedText (const ShapedText &other)
| ShapedText (TRN_ShapedText impl)
ShapedText & | operator= (const ShapedText &other)
| ~ShapedText ()
void | Destroy ()
double | GetScale () const
ShapingStatus | GetShapingStatus () const
FailureReason | GetFailureReason () const
UString | GetText () const
int | GetNumGlyphs () const
UInt32 | GetGlyph (UInt32 index) const
double | GetGlyphXPos (UInt32 index) const
double | GetGlyphYPos (UInt32 index) const

## Public Attributes
TRN_ShapedText | m_impl

## Detailed Description

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

Definition at line 23 of file ShapedText.h.

## Member Enumeration Documentation

## ◆ FailureReason

enum pdftron::PDF::ShapedText::FailureReason

Enumerator
e_NoFailure |
e_UnsupportedFontType |
e_NotIndexEncoded |
e_FontDataNotFound |

Definition at line 32 of file ShapedText.h.

## ◆ ShapingStatus

enum pdftron::PDF::ShapedText::ShapingStatus

Enumerator
e_FullShaping |
e_PartialShaping |
e_NoShaping |

Definition at line 27 of file ShapedText.h.

## Constructor & Destructor Documentation

## ◆ ShapedText() [1/3]

pdftron::PDF::ShapedText::ShapedText | ( |  | ) |

## ◆ ShapedText() [2/3]

pdftron::PDF::ShapedText::ShapedText | ( | const ShapedText & | other | ) |

## ◆ ShapedText() [3/3]

pdftron::PDF::ShapedText::ShapedText | ( | TRN_ShapedText | impl | ) |

## ◆ ~ShapedText()

pdftron::PDF::ShapedText::~ShapedText | ( |  | ) |

## Member Function Documentation

## ◆ Destroy()

void pdftron::PDF::ShapedText::Destroy | ( |  | ) |

## ◆ GetFailureReason()

FailureReason pdftron::PDF::ShapedText::GetFailureReason | ( |  | ) | const

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

Returns
  .

## ◆ GetGlyph()

UInt32 pdftron::PDF::ShapedText::GetGlyph | ( | UInt32 | index | ) | const

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.

Parameters

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

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

## ◆ GetGlyphXPos()

double pdftron::PDF::ShapedText::GetGlyphXPos | ( | UInt32 | index | ) | const

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

Parameters

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

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

## ◆ GetGlyphYPos()

double pdftron::PDF::ShapedText::GetGlyphYPos | ( | UInt32 | index | ) | const

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

Parameters

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

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

## ◆ GetNumGlyphs()

int pdftron::PDF::ShapedText::GetNumGlyphs | ( |  | ) | const

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

Returns
  returns the number of utf32 codepoints in this shaped text.

## ◆ GetScale()

double pdftron::PDF::ShapedText::GetScale | ( |  | ) | const

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.

Returns
  returns the scaling factor for the glyph positions.

## ◆ GetShapingStatus()

ShapingStatus pdftron::PDF::ShapedText::GetShapingStatus | ( |  | ) | const

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.

Returns
  .

## ◆ GetText()

UString pdftron::PDF::ShapedText::GetText | ( |  | ) | const

The original source text string.

Returns
  returns the source text string.

## ◆ operator=()

ShapedText & pdftron::PDF::ShapedText::operator= | ( | const ShapedText & | other | ) |

## Member Data Documentation

## ◆ m_impl

TRN_ShapedText pdftron::PDF::ShapedText::m_impl

Definition at line 108 of file ShapedText.h.

The documentation for this class was generated from the following file:

- PDF/ShapedText.h