ScummVM API documentation
hpl::FontData Class Reference
Inheritance diagram for hpl::FontData:
hpl::iResourceBase

Public Member Functions

 FontData (const tString &asName, iLowLevelGraphics *apLowLevelGraphics)
 
bool createFromFontFile (const tString &asFileName, int alSize, unsigned short alFirstChar, unsigned short alLastChar)
 
bool createFromBitmapFile (const tString &asFileName)
 
bool reload ()
 
void unload ()
 
void destroy ()
 
void setUp (cGraphicsDrawer *apGraphicsDrawer, LowLevelResources *apLowLevelResources, cGui *apGui)
 
GlyphgetGlyph (int alNum) const
 
unsigned short getFirstChar ()
 
unsigned short getLastChar ()
 
const cVector2fgetSizeRatio () const
 
void draw (const cVector3f &avPos, const cVector2f &avSize, const cColor &aCol, eFontAlign mAlign, const tWString &text)
 
int drawWordWrap (cVector3f avPos, float afLength, float afFontHeight, cVector2f avSize, const cColor &aCol, eFontAlign aAlign, const tWString &asString)
 
void getWordWrapRows (float afLength, float afFontHeight, cVector2f avSize, const tWString &asString, tWStringVec *apRowVec)
 
float getHeight () const
 
float getLength (const cVector2f &avSize, const char32_t *sText)
 
- Public Member Functions inherited from hpl::iResourceBase
 iResourceBase (tString asName, unsigned long alPrio)
 
tString GetName ()
 
unsigned long GetHandle ()
 
void SetHandle (unsigned long alHandle)
 
tString GetFilePath ()
 
unsigned long GetTime ()
 
unsigned long GetPrio ()
 
unsigned long GetSize ()
 
void SetLogDestruction (bool abX)
 
unsigned int GetUserCount ()
 
void IncUserCount ()
 
void DecUserCount ()
 
bool HasUsers ()
 

Additional Inherited Members

- Static Public Member Functions inherited from hpl::iResourceBase
static bool GetLogCreateAndDelete ()
 
static void SetLogCreateAndDelete (bool abX)
 
- Protected Attributes inherited from hpl::iResourceBase
unsigned int mlPrio
 
unsigned long mlTime
 
unsigned long mlSize
 
unsigned int mlUserCount
 
unsigned long mlHandle
 
tString msName
 
tString msFilePath
 
bool mbLogDestruction
 
- Static Protected Attributes inherited from hpl::iResourceBase
static bool mbLogCreateAndDelete
 

Member Function Documentation

◆ reload()

bool hpl::FontData::reload ( )
inlinevirtual

virtual bool Reload()=0;

Returns
true is reload was successful, else false.

Implements hpl::iResourceBase.

◆ unload()

void hpl::FontData::unload ( )
inlinevirtual

Free most the memory, save info to get started again.

Implements hpl::iResourceBase.

◆ destroy()

void hpl::FontData::destroy ( )
inlinevirtual

Free all memory.

Implements hpl::iResourceBase.

◆ setUp()

void hpl::FontData::setUp ( cGraphicsDrawer apGraphicsDrawer,
LowLevelResources apLowLevelResources,
cGui apGui 
)
inline

Used internally

◆ getGlyph()

Glyph* hpl::FontData::getGlyph ( int  alNum) const
inline

Used internally

Parameters
alNum
Returns

◆ draw()

void hpl::FontData::draw ( const cVector3f avPos,
const cVector2f avSize,
const cColor aCol,
eFontAlign  mAlign,
const tWString text 
)

Draw a string.

Parameters
avPosScreen pos
avSizesize of the characters
aColcolor
mAlignalignment
fmt
...

◆ drawWordWrap()

int hpl::FontData::drawWordWrap ( cVector3f  avPos,
float  afLength,
float  afFontHeight,
cVector2f  avSize,
const cColor aCol,
eFontAlign  aAlign,
const tWString asString 
)

Draw a string with word wrap.

Parameters
avPosScreen pos
afLengthMax length of a line
afFontHeightThe distance from base of character above to base of character below
avSizesize of the characters
aColcolor
aAlignalignment
asString
Returns
Extra number of rows generated.

◆ getHeight()

float hpl::FontData::getHeight ( void  ) const
inline

Get height of the font.

Returns

◆ getLength()

float hpl::FontData::getLength ( const cVector2f avSize,
const char32_t *  sText 
)

Get the length in screen size "pixels" of a string

Parameters
avSizesize of the characters
sText
Returns

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