ui::GlyphContext Class Reference

Collaboration diagram for ui::GlyphContext:

Collaboration graph
[legend]
List of all members.

Detailed Description

A singleton class which manages the Font instances. This is to prevent the Components from creating their own Font class each time.


Public Member Functions

std::size_t setFont (Font *font)
FontgetFont (std::size_t index) const
FontcreateFont (const std::string &fontname, std::size_t size)
void setFontFactory (AbstractFontFactory *factory)
AbstractFontFactorygetFontFactory () const

Static Public Member Functions

GlyphContextgetInstance ()


Member Function Documentation

std::size_t ui::GlyphContext::setFont Font font  ) 
 

Stores or sets an indexed font.

Parameters:
font the Font to use as current (is this even english?).
Returns:
the index used for this Font, or a new index if the Font wasn't used before.

Font * ui::GlyphContext::getFont std::size_t  index  )  const
 

Returns the indexed Font.

Parameters:
index the font stored in a Component.
Returns:
the Font stored on the index.

Font * ui::GlyphContext::createFont const std::string &  fontname,
std::size_t  size
 

Creates a new Font, based on a fontname, style and size.

Parameters:
fontname Font family name, such as 'Arial'
size the Font size in points.
Returns:
A pointer to the newly created Font.

void ui::GlyphContext::setFontFactory AbstractFontFactory factory  ) 
 

Sets the FontFactory to be used by GlyphContext. A FontFactory creates font based on certain parameters.

AbstractFontFactory * ui::GlyphContext::getFontFactory  )  const
 

Returns the FontFactory currently in use.

GlyphContext& ui::GlyphContext::getInstance  )  [inline, static]
 

Returns an instance of this class.

Note:
this is part of the Singleton.


Generated on Mon Jun 20 19:41:43 2005 for UI by doxygen 1.3.1 using KingsTools