NovaTK::Font Class Reference

Collaboration diagram for NovaTK::Font:

List of all members.


Detailed Description

A font specifies how text is drawn including how characters are drawn, the size of the text and its style(Regular, Bold, Italic, etc).

Public Types

enum  Style { Bold = (1 << 0), Italic = (1 << 1), Underline = (1 << 2) }

Public Member Functions

NOVATKAPI NStatus Load (const NString &l_family, int l_size, byte l_styles=0)
NOVATKAPI void Destroy ()
NOVATKAPI uint GetStringWidth (const NString &string) const
NOVATKAPI uint GetStringWidth (const NString &string, uint len) const
NOVATKAPI uint GetHeight () const
NOVATKAPI uint GetAscent () const
NOVATKAPI uint GetDescent () const
NOVATKAPI const NStringGetFamily () const
NOVATKAPI int GetSize () const

Member Enumeration Documentation

Styles affect the presentation of the font.

Enumerator:
Bold 
Italic 
Underline 


Member Function Documentation

NStatus NovaTK::Font::Load ( const NString l_family,
int  l_size,
byte  l_styles = 0 
)

Loads the specified font.

Parameters:
l_family - The name of the font family.
l_size - The point size of the font.
l_styles - Style flags to be applied. These flags are from Font::Style. If 0 then the font style is Regular.
Returns:
NOVATK_SUCCESS upon success otherwise returns NOVATK_ERROR_GENERAL_FAILURE.

void NovaTK::Font::Destroy (  ) 

Frees all memory allocated for the font.

uint NovaTK::Font::GetStringWidth ( const NString string  )  const

Calculates the total width of the string in pixels if it were displayed with this font.

uint NovaTK::Font::GetStringWidth ( const NString string,
uint  len 
) const

Calculates the total width of the specified substring in pixels if it were displayed with this font.

Parameters:
string String containing the substring.
len The length of the substring within string.
Returns:
The width of the substring in pixels.

uint NovaTK::Font::GetHeight (  )  const

Returns:
The height of the font in pixels.

uint NovaTK::Font::GetAscent (  )  const

Returns:
The ascent of the font in pixels.

uint NovaTK::Font::GetDescent (  )  const

Returns:
The descent of the font in pixels.

NOVATKAPI const NString& NovaTK::Font::GetFamily (  )  const [inline]

Returns:
The family name of the currently loaded font. If Load has not been called an empty string is returned.

NOVATKAPI int NovaTK::Font::GetSize (  )  const [inline]

Returns:
The size of the currently loaded font.


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

Generated on Sat Sep 13 22:34:19 2008 for NovaTK by  doxygen 1.5.5