VR-Forces 5.0.2 Developer's Guide
 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.

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

Classes

struct  CharacterInformation
 
class  HarfBuzzShaper
 
struct  LineInformation
 

Public Member Functions

 DtTextLayout ()
 
virtual ~DtTextLayout ()
 
 DtTextLayout (const DtTextLayout &other)=delete
 
DtTextLayoutoperator= (const DtTextLayout &other)=delete
 
virtual void renderText (DtTexturedGlyphRenderer *, const DtTextProxy *, DtFontSP, const DtBoundingBox &)
 
virtual DtUnicode bidiFix (const DtUnicode &) const
 
virtual Dt2dPoint calculateGlyphSize (const DtFontSP &font, const DtPen &pen, const DtUnicode &string, unsigned int pos=0, int len=-1) const
 
virtual DtBoundingBox calculateBoundingBox (const DtFontSP &font, const DtPen &pen, const DtUnicode &string, unsigned int pos=0, int len=-1) const
 
virtual bool isShaped (void) const
 
virtual void layoutRightToLeft (const DtTextProxy *, DtFontSP, const DtBoundingBox &)
 
virtual void layoutLeftToRight (const DtTextProxy *, DtFontSP, const DtBoundingBox &)
 
- Public Member Functions inherited from makVrv::DtTextLayoutInterface
 DtTextLayoutInterface ()
 
virtual ~DtTextLayoutInterface ()
 
 DtTextLayoutInterface (const DtTextLayoutInterface &other)=delete
 
DtTextLayoutInterfaceoperator= (const DtTextLayoutInterface &other)=delete
 

Protected Types

typedef std::vector
< LineInformation
Lines
 

Protected Member Functions

virtual bool renderCharacter (DtGlyphRenderer &renderer, DtPen &pen, const DtFontSP &font, const unsigned int &character)
 
virtual void renderLayout (DtTexturedGlyphRenderer *, const DtTextProxy *, DtFontSP, const DtBoundingBox &)
 

Protected Attributes

HarfBuzzShaper myShaper
 
std::vector< std::string > myFontFilePaths
 
unsigned int myPointSize
 
DtUnicode myLastStringRendered
 
DtUnicode myRenderedText
 
Lines myLines
 
double myLineLength
 
bool myRightToLeftLayout
 

Member Typedef Documentation

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

Constructor & Destructor Documentation

makVrv::DtTextLayout::DtTextLayout ( )

CTOR.

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

DTOR.

makVrv::DtTextLayout::DtTextLayout ( const DtTextLayout other)
delete

Copy Constructor not implemented - Copy not allowed.

Member Function Documentation

DtTextLayout& makVrv::DtTextLayout::operator= ( const DtTextLayout other)
delete

Assignment Operator not implemented - Assignment not allowed.

virtual void makVrv::DtTextLayout::renderText ( DtTexturedGlyphRenderer ,
const DtTextProxy ,
DtFontSP  ,
const DtBoundingBox  
)
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 
) const
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 
) const
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 ,
DtFontSP  ,
const DtBoundingBox  
)
virtual
virtual void makVrv::DtTextLayout::layoutLeftToRight ( const DtTextProxy ,
DtFontSP  ,
const DtBoundingBox  
)
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 ,
const DtTextProxy ,
DtFontSP  ,
const DtBoundingBox  
)
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 Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)