FontFamily class. More...

#include <font_family.h>

Public Member Functions

 FontFamily ()
 Constructs a null font family. More...
 
 FontFamily (const std::string &family_name)
 Constructs a font family with the given family name. More...
 
void add (const std::string &typeface_name, float height)
 Add standard font. More...
 
void add (const std::string &typeface_name, const FontDescription &desc)
 
void add (const FontDescription &desc, const std::string &ttf_filename)
 
void add (const FontDescription &desc, const std::string &ttf_filename, FileSystem fs)
 
void add (Canvas &canvas, Sprite &sprite, const std::string &glyph_list, float spacelen, bool monospace, const FontMetrics &metrics)
 Add a Font based on a sprite. More...
 
const std::stringget_family_name () const
 Font family name used for this font family. More...
 
bool is_null () const
 Returns true if this object is invalid. More...
 
 operator bool () const
 
void throw_if_null () const
 Throw an exception if this object is invalid. More...
 

Friends

class Font_Impl
 

Detailed Description

FontFamily class.

A FontFamily is a collection of font descriptions

Constructor & Destructor Documentation

clan::FontFamily::FontFamily ( )

Constructs a null font family.

clan::FontFamily::FontFamily ( const std::string family_name)

Constructs a font family with the given family name.

Member Function Documentation

void clan::FontFamily::add ( const std::string typeface_name,
float  height 
)

Add standard font.

void clan::FontFamily::add ( const std::string typeface_name,
const FontDescription desc 
)
void clan::FontFamily::add ( const FontDescription desc,
const std::string ttf_filename 
)
void clan::FontFamily::add ( const FontDescription desc,
const std::string ttf_filename,
FileSystem  fs 
)
void clan::FontFamily::add ( Canvas canvas,
Sprite sprite,
const std::string glyph_list,
float  spacelen,
bool  monospace,
const FontMetrics metrics 
)

Add a Font based on a sprite.

Parameters
sprite= Sprite with glyphs
glyph_list= Letter to glyph mapping
spacelen= Width of space character
monospace= Force monospaced font (using widest sprite character)
metrics= Font metrics for the sprite font
const std::string& clan::FontFamily::get_family_name ( ) const

Font family name used for this font family.

bool clan::FontFamily::is_null ( ) const
inline

Returns true if this object is invalid.

clan::FontFamily::operator bool ( ) const
inlineexplicit
void clan::FontFamily::throw_if_null ( ) const

Throw an exception if this object is invalid.

Friends And Related Function Documentation

friend class Font_Impl
friend

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