Rocket::Core::FontDatabase Class Reference

#include <FontDatabase.h>

Collaboration diagram for Rocket::Core::FontDatabase:

Static Public Member Functions

static bool Initialise ()
static void Shutdown ()
static bool LoadFontFace (const String &file_name)
static bool LoadFontFace (const String &file_name, const String &family, Font::Style style, Font::Weight weight)
static bool LoadFontFace (const byte *data, int data_length, const String &family, Font::Style style, Font::Weight weight)
static FontFaceHandleGetFontFaceHandle (const String &family, const String &charset, Font::Style style, Font::Weight weight, int size)
static FontEffectGetFontEffect (const String &name, const PropertyDictionary &properties)
static void ReleaseFontEffect (const FontEffect *effect)

Detailed Description

The font database contains all font families currently in use by Rocket.

Author:
Peter Curry

Member Function Documentation

bool Rocket::Core::FontDatabase::LoadFontFace ( const String file_name  )  [static]

Adds a new font face to the database. The face's family, style and weight will be determined from the face itself.

Parameters:
[in] file_name The file to load the face from.
Returns:
True if the face was loaded successfully, false otherwise.

bool Rocket::Core::FontDatabase::LoadFontFace ( const String file_name,
const String family,
Font::Style  style,
Font::Weight  weight 
) [static]

Adds a new font face to the database, ignoring any family, style and weight information stored in the face itself.

Parameters:
[in] file_name The file to load the face from.
[in] family The family to add the face to.
[in] style The style of the face (normal or italic).
[in] weight The weight of the face (normal or bold).
Returns:
True if the face was loaded successfully, false otherwise.

bool Rocket::Core::FontDatabase::LoadFontFace ( const byte *  data,
int  data_length,
const String family,
Font::Style  style,
Font::Weight  weight 
) [static]

Adds a new font face to the database, loading from memory.

Parameters:
[in] data The font data.
[in] data_length Length of the data.
[in] family The family to add the face to.
[in] style The style of the face (normal or italic).
[in] weight The weight of the face (normal or bold).
Returns:
True if the face was loaded successfully, false otherwise.

FontFaceHandle * Rocket::Core::FontDatabase::GetFontFaceHandle ( const String family,
const String charset,
Font::Style  style,
Font::Weight  weight,
int  size 
) [static]

Returns a handle to a font face that can be used to position and render text. This will return the closest match it can find, but in the event a font family is requested that does not exist, NULL will be returned instead of a valid handle.

Parameters:
[in] family The family of the desired font handle.
[in] charset The set of characters required in the font face, as a comma-separated list of unicode ranges.
[in] style The style of the desired font handle.
[in] weight The weight of the desired font handle.
[in] size The size of desired handle, in points.
Returns:
A valid handle if a matching (or closely matching) font face was found, NULL otherwise.

FontEffect * Rocket::Core::FontDatabase::GetFontEffect ( const String name,
const PropertyDictionary properties 
) [static]

Returns a font effect, either a newly-instanced effect from the factory or an identical shared effect.

Parameters:
[in] name The name of the desired font effect type.
[in] properties The properties associated with the font effect.
Returns:
The requested font effect, or NULL if the font effect could not be found or instanced.

void Rocket::Core::FontDatabase::ReleaseFontEffect ( const FontEffect effect  )  [static]

Removes a font effect from the font database's cache.

Parameters:
[in] The effect to release.


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