VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
makVrv::DtTextLayout Class Reference

A class for rendering text objects using harfbuzz layout for right to left and left to right text shaping. More...

Inheritance diagram for makVrv::DtTextLayout:
Inheritance graph
[legend]

Classes

struct  CharacterInformation
 Stucture that contains information about a particular character, color change or simple line/character advancement. More...
class  HarfBuzzShaper
struct  LineInformation
 Structure that contains information about the layout of a line of text. More...

Public Member Functions

 DtTextLayout ()
 CTOR.
virtual ~DtTextLayout ()
 DTOR.
virtual void renderText (DtTexturedGlyphRenderer *, DtTextProxy *)
 Renders the text to the given glyph renderer.
virtual DtUnicode bidiFix (const DtUnicode &) const
 Fixes the text for bi-directional issues. Currently only reverses numerals for right to left text.
virtual Dt2dPoint calculateGlyphSize (const DtFontSP &font, const DtPen &pen, const DtUnicode &string, unsigned int pos=0, int len=-1)
 Calculates the bounding box for a string.
virtual DtBoundingBox calculateBoundingBox (const DtFontSP &font, const DtPen &pen, const DtUnicode &string, unsigned int pos=0, int len=-1)
 Calculate the bounding box for a string.
virtual bool isShaped (void) const
virtual void layoutRightToLeft (const DtTextProxy *)
virtual void layoutLeftToRight (const DtTextProxy *)
- Public Member Functions inherited from makVrv::DtTextLayoutInterface
 DtTextLayoutInterface ()
 CTOR.
virtual ~DtTextLayoutInterface ()
 DTOR.

Protected Types

typedef std::vector
< LineInformation
Lines

Protected Member Functions

virtual bool renderCharacter (DtGlyphRenderer &renderer, DtPen &pen, const DtFontSP &font, const unsigned int &character)
 Renders the character to the position specified by the pen.
virtual void renderLayout (DtTexturedGlyphRenderer *, DtTextProxy *)
 Renders the laid out text to the given renderer.

Protected Attributes

HarfBuzzShaper myShaper
std::vector< std::string > myFontFilePaths
 Members that are used to store information about the last font/point size used.
unsigned int myPointSize
DtUnicode myLastStringRendered
DtUnicode myRenderedText
Lines myLines
double myLineLength
bool myRightToLeftLayout

Detailed Description

A class for rendering text objects using harfbuzz layout for right to left and left to right text shaping.

Member Typedef Documentation

typedef std::vector<LineInformation> makVrv::DtTextLayout::Lines
protected

Constructor & Destructor Documentation

makVrv::DtTextLayout::DtTextLayout ( )

CTOR.

virtual makVrv::DtTextLayout::~DtTextLayout ( )
virtual

DTOR.

Member Function Documentation

virtual void makVrv::DtTextLayout::renderText ( DtTexturedGlyphRenderer ,
DtTextProxy  
)
virtual

Renders the text to the given glyph renderer.

Implements makVrv::DtTextLayoutInterface.

virtual DtUnicode makVrv::DtTextLayout::bidiFix ( const DtUnicode ) const
virtual

Fixes the text for bi-directional issues. Currently only reverses numerals for right to left text.

virtual Dt2dPoint makVrv::DtTextLayout::calculateGlyphSize ( const DtFontSP font,
const DtPen pen,
const DtUnicode string,
unsigned int  pos = 0,
int  len = -1 
)
virtual

Calculates the bounding box for a string.

Implements makVrv::DtTextLayoutInterface.

virtual DtBoundingBox makVrv::DtTextLayout::calculateBoundingBox ( const DtFontSP font,
const DtPen pen,
const DtUnicode string,
unsigned int  pos = 0,
int  len = -1 
)
virtual

Calculate the bounding box for a string.

Implements makVrv::DtTextLayoutInterface.

virtual bool makVrv::DtTextLayout::isShaped ( void  ) const
inlinevirtual
virtual void makVrv::DtTextLayout::layoutRightToLeft ( const DtTextProxy )
virtual
virtual void makVrv::DtTextLayout::layoutLeftToRight ( const DtTextProxy )
virtual
virtual bool makVrv::DtTextLayout::renderCharacter ( DtGlyphRenderer renderer,
DtPen pen,
const DtFontSP font,
const unsigned int character 
)
protectedvirtual

Renders the character to the position specified by the pen.

virtual void makVrv::DtTextLayout::renderLayout ( DtTexturedGlyphRenderer ,
DtTextProxy  
)
protectedvirtual

Renders the laid out text to the given renderer.

Member Data Documentation

HarfBuzzShaper makVrv::DtTextLayout::myShaper
protected
std::vector<std::string> makVrv::DtTextLayout::myFontFilePaths
protected

Members that are used to store information about the last font/point size used.

Used for efficiency

unsigned int makVrv::DtTextLayout::myPointSize
protected
DtUnicode makVrv::DtTextLayout::myLastStringRendered
protected
DtUnicode makVrv::DtTextLayout::myRenderedText
protected
Lines makVrv::DtTextLayout::myLines
protected
double makVrv::DtTextLayout::myLineLength
protected
bool makVrv::DtTextLayout::myRightToLeftLayout
protected

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

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)