Drag[en]gine Game Engine  1.0
deFont Class Reference

Text Font class. More...

#include <deFont.h>

Inheritance diagram for deFont:
deFileResource deResource deObject

Public Member Functions

Management
int GetLineHeight () const
 
void SetLineHeight (int lineHeight)
 
bool GetIsColorFont () const
 
void SetIsColorFont (bool colorFont)
 
int GetFontWidth () const
 
void UpdateGlyphs ()
 
bool Verify ()
 
deFontGlyphGetGlyph (int code) const
 
const char * GetImagePath () const
 
void SetImagePath (const char *imagePath)
 
deImageGetImage () const
 
void SetImage (deImage *image)
 
System Peers
deBaseGraphicFontGetGraphicFont () const
 
void SetGraphicFont (deBaseGraphicFont *font)
 
- Public Member Functions inherited from deFileResource
deVirtualFileSystemGetVirtualFileSystem () const
 Virtual file system or NULL if build from memory. More...
 
const decStringGetFilename () const
 Filename or empty string if build from memory. More...
 
bool GetAsynchron () const
 Resource is asynchron. More...
 
void SetAsynchron (bool asynchron)
 Set if resource is asynchron. More...
 
 deFileResource (deResourceManager *resourceManager, deVirtualFileSystem *vfs, const char *filename)
 Create file resource. More...
 
- Public Member Functions inherited from deResource
deResourceManagerGetResourceManager () const
 Resource manager or NULL if resource is leaking. More...
 
deEngineGetEngine () const
 Game engine object from resource manager. More...
 
deResourceGetLLManagerPrev () const
 Previous resource in the resource manager linked list. More...
 
void SetLLManagerPrev (deResource *resource)
 Set next resource in the resource manager linked list. More...
 
deResourceGetLLManagerNext () const
 Next resource in the resource manager linked list. More...
 
void SetLLManagerNext (deResource *resource)
 Set next resource in the resource manager linked list. More...
 
void MarkLeaking ()
 Marks the resource leaking. More...
 
 deResource (deResourceManager *resourceManager)
 Create resource. More...
 
- Public Member Functions inherited from deObject
int GetRefCount () const
 Reference count. More...
 
void AddReference ()
 Add reference increasing reference count by 1. More...
 
void FreeReference ()
 Decrease reference count by one and delete object if count reaches 0. More...
 
 deObject ()
 Create object with reference count of 1. More...
 

Constructors and Destructors

 deFont (deFontManager *manager, deVirtualFileSystem *vfs, const char *filename)
 
virtual ~deFont ()
 Clean up font. More...
 

Additional Inherited Members

- Protected Member Functions inherited from deFileResource
virtual ~deFileResource ()
 Clean up file resource. More...
 
- Protected Member Functions inherited from deResource
virtual ~deResource ()
 Clean up resource. More...
 
- Protected Member Functions inherited from deObject
virtual ~deObject ()
 Clean up object. More...
 

Detailed Description

Text Font class.

Provides support for fonts to be used in guis or 3d rendering. Fonts are based on skins and hence are bitmap fonts.

Author
Pl├╝ss Roland
Version
1.0
Date
2008

Constructor & Destructor Documentation

◆ deFont()

deFont::deFont ( deFontManager manager,
deVirtualFileSystem vfs,
const char *  filename 
)

Creates a new font object with the given resource manager and filename.

◆ ~deFont()

virtual deFont::~deFont ( )
protectedvirtual

Clean up font.

Note
Subclasses should set their destructor protected too to avoid users accidently deleting a reference counted object through the object pointer. Only FreeReference() is allowed to delete the object.

Member Function Documentation

◆ GetFontWidth()

int deFont::GetFontWidth ( ) const
inline

Retrieves the width of the font glyphs.

References GetGlyph(), UpdateGlyphs(), and Verify().

◆ GetGlyph()

deFontGlyph* deFont::GetGlyph ( int  code) const

Retrieves the glyph for the given code. The code is supposed to be an UTF8 code in the range of 0 to 255 inclusive.

Referenced by GetFontWidth().

◆ GetGraphicFont()

deBaseGraphicFont* deFont::GetGraphicFont ( ) const
inline

Retrieves the graphic system peer.

References SetGraphicFont().

◆ GetImage()

deImage* deFont::GetImage ( ) const
inline

Retrieves the image object if existing.

References SetImage().

◆ GetImagePath()

const char* deFont::GetImagePath ( ) const
inline

Retrieves the path to the image if existing.

References SetImagePath().

◆ GetIsColorFont()

bool deFont::GetIsColorFont ( ) const
inline

Determines if this is a color font that can not be tinted.

References SetIsColorFont().

◆ GetLineHeight()

int deFont::GetLineHeight ( ) const
inline

Retrieves the height of a line of text.

References SetLineHeight().

◆ SetGraphicFont()

void deFont::SetGraphicFont ( deBaseGraphicFont font)

Sets the graphic system peer.

Referenced by GetGraphicFont().

◆ SetImage()

void deFont::SetImage ( deImage image)

Sets the image object or NULL if not used.

Referenced by GetImage().

◆ SetImagePath()

void deFont::SetImagePath ( const char *  imagePath)

Sets the path to the image if existing.

Referenced by GetImagePath().

◆ SetIsColorFont()

void deFont::SetIsColorFont ( bool  colorFont)

Sets if this is a color font that can not be tinted.

Referenced by GetIsColorFont().

◆ SetLineHeight()

void deFont::SetLineHeight ( int  lineHeight)

Sets the height of a line of text.

Referenced by GetLineHeight().

◆ UpdateGlyphs()

void deFont::UpdateGlyphs ( )

Update the glyphs.

Referenced by GetFontWidth().

◆ Verify()

bool deFont::Verify ( )

Verify the settings of the font object.

Referenced by GetFontWidth().


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