VR-Forces 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 *, DtFontInterface *font, const DtBoundingBox &bBox, const DtObserverRenderData &channelRenderData, int proxyIndex, DtQuadsRenderData *renderData)
 
virtual DtUnicode bidiFix (const DtUnicode &) const
 
virtual DtBoundingBox calculateBoundingBox (DtFontInterface *font, const DtUnicode &string, const DtPen &pen=DtPen(), unsigned int pos=0, int len=-1) const
 
virtual bool isShaped (void) const
 
virtual void layoutRightToLeft (const DtTextProxy *, DtFontInterface *, const DtBoundingBox &)
 
virtual void layoutLeftToRight (const DtTextProxy *, DtFontInterface *, 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, const DtTextProxy *textProxy, DtPen &pen, DtFontInterface *font, const unsigned int &character, int &vertexIndex, const std::unordered_map< unsigned int, int > &mapTextureIdToTextureIndex)
 
virtual void renderLayout (DtTexturedGlyphRenderer *, const DtTextProxy *, DtFontInterface *, const DtBoundingBox &, int &vertexIndex, const std::unordered_map< unsigned int, int > &mapTextureIdToTextureIndex)
 

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 ,
DtFontInterface font,
const DtBoundingBox bBox,
const DtObserverRenderData channelRenderData,
int  proxyIndex,
DtQuadsRenderData renderData 
)
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 DtBoundingBox makVrv::DtTextLayout::calculateBoundingBox ( DtFontInterface font,
const DtUnicode string,
const DtPen pen = DtPen(),
unsigned int  pos = 0,
int  len = -1 
) const
virtual

Calculates the bounding box, in screen space, for the passed in string and font. By default, this function calculates the bounding box for the entire passed in string but it can also calculate the bounding box for a substring of the passed in string.

Parameters
fontThe font to use when calculating the bounds for a string.
stringThe string to calculate the bounds for.
penSpecifies the spacing and starting position to use when calculating the bounding box.
posThe position, within the passed in string, of the first character for the substring to calculate the bounding box for.
lenThe number of characters, from pos, to consider in the passed in string. If -1, consider all remaining characters in the string.

Implements makVrv::DtTextLayoutInterface.

virtual bool makVrv::DtTextLayout::isShaped ( void  ) const
inlinevirtual
virtual void makVrv::DtTextLayout::layoutRightToLeft ( const DtTextProxy ,
DtFontInterface ,
const DtBoundingBox  
)
virtual
virtual void makVrv::DtTextLayout::layoutLeftToRight ( const DtTextProxy ,
DtFontInterface ,
const DtBoundingBox  
)
virtual
virtual bool makVrv::DtTextLayout::renderCharacter ( DtGlyphRenderer renderer,
const DtTextProxy textProxy,
DtPen pen,
DtFontInterface font,
const unsigned int character,
int vertexIndex,
const std::unordered_map< unsigned int, int > &  mapTextureIdToTextureIndex 
)
protectedvirtual

Renders the character to the position specified by the pen.

virtual void makVrv::DtTextLayout::renderLayout ( DtTexturedGlyphRenderer ,
const DtTextProxy ,
DtFontInterface ,
const DtBoundingBox ,
int vertexIndex,
const std::unordered_map< unsigned int, int > &  mapTextureIdToTextureIndex 
)
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 Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)