All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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)
 
ShapedTextoperator= (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

Enumerator
e_NoFailure 
e_UnsupportedFontType 
e_NotIndexEncoded 
e_FontDataNotFound 

Definition at line 32 of file ShapedText.h.

Enumerator
e_FullShaping 
e_PartialShaping 
e_NoShaping 

Definition at line 27 of file ShapedText.h.

Constructor & Destructor Documentation

pdftron::PDF::ShapedText::ShapedText ( )
pdftron::PDF::ShapedText::ShapedText ( const ShapedText other)
pdftron::PDF::ShapedText::ShapedText ( TRN_ShapedText  impl)
pdftron::PDF::ShapedText::~ShapedText ( )

Member Function Documentation

void pdftron::PDF::ShapedText::Destroy ( )
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
.
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.
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.
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.
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.
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.
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
.
UString pdftron::PDF::ShapedText::GetText ( ) const

The original source text string.

Returns
returns the source text string.
ShapedText& pdftron::PDF::ShapedText::operator= ( const ShapedText other)

Member Data Documentation

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: