VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Friends
makVrv::DtFont Class Reference

A class with encapsulated a font loaded from disk with a given size.

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

Public Member Functions

 ~DtFont ()
 
const std::string & fontName () const
 
bool attachFile (const char *fontFilePath)
 
void setFreeTypeLoadFlags (unsigned int flags)
 
bool setCharacterMap (unsigned int encoding)
 
const unsigned intcharacterMaps ()
 
unsigned int characterMapCount () const
 
const DtFreeTypeFacefreeTypeFace () const
 
bool setFaceSize (const unsigned int size)
 
unsigned int faceSize () const
 
float globalAscender () const
 
float globalDescender () const
 
virtual float lineHeight () const
 
virtual DtBoundingBox calculateBoundingBox (const DtPen &pen, const DtUnicode &string, unsigned int pos=0, int len=-1)
 
virtual Dt2dPoint calculateGlyphSize (const DtPen &pen, const DtUnicode &string, unsigned int pos=0, int len=-1)
 
float calculateAdvance (const DtPen &pen, const DtUnicode &string, unsigned int pos=0, int len=-1)
 
void releaseResources ()
 
bool isValid () const
 
bool checkError () const
 
DtGlyphfindOrLoadGlyphForRendering (DtGlyphRenderer &renderer, const unsigned int characterCode, bool characterCodeIsIndex=false)
 
DtGlyphfindOrLoadGlyph (const unsigned int chr)
 
unsigned int indexInFont (const unsigned int characterCode) const
 
Dt2dPoint calculateKerning (unsigned int index1, unsigned int index2)
 
- Public Member Functions inherited from makVrv::DtFontInterface
 DtFontInterface ()=default
 
 ~DtFontInterface ()
 

Protected Member Functions

 DtFont (DtGLFontManager &fm, const std::string &fontFilePath)
 

Protected Attributes

FontPrivate * myImpl
 

Friends

class DtGLFontManager
 

Additional Inherited Members

- Public Types inherited from makVrv::DtFontInterface
enum  TextAlignment { AlignLeft, AlignCenter, AlignRight, AlignJustify }
 

Constructor & Destructor Documentation

makVrv::DtFont::~DtFont ( )

DTOR.

makVrv::DtFont::DtFont ( DtGLFontManager fm,
const std::string &  fontFilePath 
)
protected

CTOR create and load a font.

Member Function Documentation

const std::string& makVrv::DtFont::fontName ( ) const

Get the name.

bool makVrv::DtFont::attachFile ( const char fontFilePath)

Attach auxilliary file to font e.g font metrics.

void makVrv::DtFont::setFreeTypeLoadFlags ( unsigned int  flags)

Set the FreeType load flags.

bool makVrv::DtFont::setCharacterMap ( unsigned int  encoding)

Set the FreeType characte encoding map.

const unsigned int* makVrv::DtFont::characterMaps ( )

Get the list of character maps.

unsigned int makVrv::DtFont::characterMapCount ( ) const

Get the number of charater maps.

const DtFreeTypeFace& makVrv::DtFont::freeTypeFace ( ) const
bool makVrv::DtFont::setFaceSize ( const unsigned int  size)
unsigned int makVrv::DtFont::faceSize ( ) const
float makVrv::DtFont::globalAscender ( ) const
float makVrv::DtFont::globalDescender ( ) const
virtual float makVrv::DtFont::lineHeight ( ) const
virtual
virtual DtBoundingBox makVrv::DtFont::calculateBoundingBox ( const DtPen pen,
const DtUnicode string,
unsigned int  pos = 0,
int  len = -1 
)
virtual

Calculate the bounding box for a string.

Implements makVrv::DtFontInterface.

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

Calculate the bounding box for a string.

Implements makVrv::DtFontInterface.

float makVrv::DtFont::calculateAdvance ( const DtPen pen,
const DtUnicode string,
unsigned int  pos = 0,
int  len = -1 
)
void makVrv::DtFont::releaseResources ( )
bool makVrv::DtFont::isValid ( ) const
virtual

Returns true if this font is valid (has a character map)

Implements makVrv::DtFontInterface.

bool makVrv::DtFont::checkError ( ) const

Asks the private implementation to see if there is an error with the font.

DtGlyph* makVrv::DtFont::findOrLoadGlyphForRendering ( DtGlyphRenderer renderer,
const unsigned int  characterCode,
bool  characterCodeIsIndex = false 
)

Returns the glyph to render given the character code. If characterCodeIsIndex is true then the character code given is an index into the font, not the character code itself.

DtGlyph* makVrv::DtFont::findOrLoadGlyph ( const unsigned int  chr)

Load the glyph, or return null if the glyph is not loaded.

unsigned int makVrv::DtFont::indexInFont ( const unsigned int  characterCode) const

Returns the absolute index of the font in the font set given the font character. Internally used to map character font to its index.

Dt2dPoint makVrv::DtFont::calculateKerning ( unsigned int  index1,
unsigned int  index2 
)

Friends And Related Function Documentation

friend class DtGLFontManager
friend

Member Data Documentation

FontPrivate* makVrv::DtFont::myImpl
protected

Internal FTGL FTFont implementation object. For private use only.


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

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)