FontFamily class

FontFamily objects are used to house all related font styles allocated as FontStyle objects.

Member Functions

FontFamily(font_family name) | ~FontFamily(void)
font_family GetName(void) | void AddStyle(FontStyle *style)
void RemoveStyle(FontStyle *style) | FontStyle *FindStyle(font_style name)

FontFamily(font_family name)

1) Set internal name to the one passed to the constructor

~FontFamily(void)

1) Does nothing

font_family GetName(void)

Returns the internal family name

void AddStyle(FontStyle *style)

Adds the style to the family. Note that the FontFamily object is not responsible for freeing FontStyle objects added in this way.

1) Add the style object to the internal STL map object for styles

void RemoveStyle(FontStyle *style)

Removes the style from the FontFamily object.

1) Find the style in the style list. Return if not found.

2) Delete the style list's item

3) If the style list is now empty, ask the FontServer to remove it from the family list

FontStyle *FindStyle(font_style name)

Looks up a FontStyle object based on its style name. Returns NULL if not found.

1) Call the style list's find() method.

2) Return the appropriate FontStyle object or NULL if not found.