clan::FontFamily Class Reference - ClanLib SDK
Description: clan::FontFamily Class Reference

Public Member Functions | Friends | List of all members
clan::FontFamily Class Reference
clanDisplay Font

FontFamily class. More...

`#include <font_family.h>`

## Public Member Functions
| FontFamily ()
| Constructs a null font family.
| FontFamily (const std::string &family_name, const TextureGroup &new_texture_group=TextureGroup(Size(256, 256)))
| Constructs a font family with the given family name.
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.
void | add (const FontDescription &desc, const std::string &ttf_filename)
void | add (const FontDescription &desc, const std::string &ttf_filename, FileSystem fs)
void | add (const std::string &typeface_name, const FontDescription &desc)
void | add (const std::string &typeface_name, float height)
| Add standard font.
const std::string & | get_family_name () const
| Font family name used for this font family.
bool | is_null () const
| Returns true if this object is invalid.
| operator bool () const
void | throw_if_null () const
| Throw an exception if this object is invalid.

## Friends
class | Font_Impl

## Detailed Description

FontFamily class.

A FontFamily is a collection of font descriptions

## Constructor & Destructor Documentation

## ◆ FontFamily() [1/2]

clan::FontFamily::FontFamily | ( |  | ) |

Constructs a null font family.

## ◆ FontFamily() [2/2]

clan::FontFamily::FontFamily | ( | const std::string & | family_name,
|  | const TextureGroup & | new_texture_group = TextureGroup(Size(256, 256)) )

Constructs a font family with the given family name.

## Member Function Documentation

## ◆ add() [1/5]

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

References clan::sprite.

## ◆ add() [2/5]

void clan::FontFamily::add | ( | const FontDescription & | desc,
|  | const std::string & | ttf_filename )

## ◆ add() [3/5]

void clan::FontFamily::add | ( | const FontDescription & | desc,
|  | const std::string & | ttf_filename,
|  | FileSystem | fs )

## ◆ add() [4/5]

void clan::FontFamily::add | ( | const std::string & | typeface_name,
|  | const FontDescription & | desc )

## ◆ add() [5/5]

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

Add standard font.

## ◆ get_family_name()

const std::string & clan::FontFamily::get_family_name | ( |  | ) | const

Font family name used for this font family.

## ◆ is_null()

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

Returns true if this object is invalid.

## ◆ operator bool()

clan::FontFamily::operator bool | ( |  | ) | const
| inlineexplicit

## ◆ throw_if_null()

void clan::FontFamily::throw_if_null | ( |  | ) | const

Throw an exception if this object is invalid.

## Friends And Related Symbol Documentation

## ◆ Font_Impl

friend class Font_Impl
| friend

References Font_Impl.

Referenced by Font_Impl.

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

- font_family.h