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

Public Types | Public Member Functions | Static Public Member Functions | List of all members
clan::FontDescription Class Reference
clanDisplay Font

Font description class. More...

`#include <font_description.h>`

## Public Types
enum | Charset { charset_default , charset_ansi , charset_baltic , charset_chinesebig5 , charset_easteurope , charset_gb2312 , charset_greek , charset_hangul , charset_mac , charset_oem , charset_russian , charset_shiftjis , charset_symbol , charset_turkish , charset_vietnamese , charset_johab , charset_arabic , charset_hebrew , charset_thai }

## Public Member Functions
| FontDescription ()
| Constructs a font description with default values.
virtual | ~FontDescription ()
FontDescription | clone () const
bool | get_anti_alias () const
| Get the font anti-alias setting (defaults to true).
float | get_average_width () const
| Returns the font average width.
Charset | get_charset () const
| \biref Get the font charset
float | get_escapement () const
| Returns the font escapement.
float | get_height () const
| Returns the font height.
float | get_line_height () const
| Returns the distance between each line.
float | get_orientation () const
| Returns the font orientation.
FontStyle | get_style () const
| Returns the font style.
bool | get_subpixel () const
| Get the font subpixel rendering setting (defaults to true).
std::string | get_unique_id () const
| Returns an unique string identifying this font description.
FontWeight | get_weight () const
| Returns the font weight.
bool | is_null () const
| Returns true if this object is invalid.
| operator bool () const
FontDescription & | operator= (const FontDescription &copy)
| Copy assignment operator (does not copy the description, use clone() if you want that).
bool | operator== (const FontDescription &other) const
| Returns true if the font is identical Line_height is excluded.
void | set_anti_alias (bool setting=true)
| Sets the font anti-alias setting (defaults to true).
void | set_average_width (float value=0.0f)
| Sets the font average width.
void | set_charset (Charset new_charset)
| Sets the font charset (defaults to charset_default).
void | set_escapement (float value)
| Sets the font escapement.
void | set_height (float value=20.0f)
| Sets the font height.
void | set_line_height (float height)
| Sets the distance between each line.
void | set_orientation (float value)
| Sets the font orientation.
void | set_style (FontStyle setting=FontStyle::normal)
| Sets the font style.
void | set_subpixel (bool setting=true)
| Sets the font subpixel rendering setting (defaults to true).
void | set_weight (FontWeight value=FontWeight::normal)
| Sets the font weight.
void | throw_if_null () const
| Throw an exception if this object is invalid.

## Static Public Member Functions
static FontDescription | create_null_object ()
| Create null object.

## Detailed Description

Font description class.

This class allows you to setup a more advanced description when creating a font.

## Member Enumeration Documentation

## ◆ Charset

enum clan::FontDescription::Charset

Enumerator
charset_default |
charset_ansi |
charset_baltic |
charset_chinesebig5 |
charset_easteurope |
charset_gb2312 |
charset_greek |
charset_hangul |
charset_mac |
charset_oem |
charset_russian |
charset_shiftjis |
charset_symbol |
charset_turkish |
charset_vietnamese |
charset_johab |
charset_arabic |
charset_hebrew |
charset_thai |

## Constructor & Destructor Documentation

## ◆ FontDescription()

clan::FontDescription::FontDescription | ( |  | ) |

Constructs a font description with default values.

Referenced by clone(), create_null_object(), operator=(), and operator==().

## ◆ ~FontDescription()

virtual clan::FontDescription::~FontDescription | ( |  | ) |
| virtual

## Member Function Documentation

## ◆ clone()

FontDescription clan::FontDescription::clone | ( |  | ) | const

References FontDescription().

## ◆ create_null_object()

FontDescription clan::FontDescription::create_null_object | ( |  | ) |
| static

Create null object.

Returns
  Font Description

References FontDescription().

## ◆ get_anti_alias()

bool clan::FontDescription::get_anti_alias | ( |  | ) | const

Get the font anti-alias setting (defaults to true).

## ◆ get_average_width()

float clan::FontDescription::get_average_width | ( |  | ) | const

Returns the font average width.

0.0f = Use default

## ◆ get_charset()

Charset clan::FontDescription::get_charset | ( |  | ) | const

\biref Get the font charset

## ◆ get_escapement()

float clan::FontDescription::get_escapement | ( |  | ) | const

Returns the font escapement.

## ◆ get_height()

float clan::FontDescription::get_height | ( |  | ) | const

Returns the font height.

## ◆ get_line_height()

float clan::FontDescription::get_line_height | ( |  | ) | const

Returns the distance between each line.

## ◆ get_orientation()

float clan::FontDescription::get_orientation | ( |  | ) | const

Returns the font orientation.

## ◆ get_style()

FontStyle clan::FontDescription::get_style | ( |  | ) | const

Returns the font style.

## ◆ get_subpixel()

bool clan::FontDescription::get_subpixel | ( |  | ) | const

Get the font subpixel rendering setting (defaults to true).

## ◆ get_unique_id()

std::string clan::FontDescription::get_unique_id | ( |  | ) | const

Returns an unique string identifying this font description.

This is useful for placing font descriptions in a map. Line_height is excluded.

## ◆ get_weight()

FontWeight clan::FontDescription::get_weight | ( |  | ) | const

Returns the font weight.

## ◆ is_null()

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

Returns true if this object is invalid.

## ◆ operator bool()

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

## ◆ operator=()

FontDescription & clan::FontDescription::operator= | ( | const FontDescription & | copy | ) |

Copy assignment operator (does not copy the description, use clone() if you want that).

References FontDescription().

## ◆ operator==()

bool clan::FontDescription::operator== | ( | const FontDescription & | other | ) | const

Returns true if the font is identical Line_height is excluded.

References FontDescription().

## ◆ set_anti_alias()

void clan::FontDescription::set_anti_alias | ( | bool | setting = true | ) |

Sets the font anti-alias setting (defaults to true).

## ◆ set_average_width()

void clan::FontDescription::set_average_width | ( | float | value = 0.0f | ) |

Sets the font average width.

0.0f = Use default

## ◆ set_charset()

void clan::FontDescription::set_charset | ( | Charset | new_charset | ) |

Sets the font charset (defaults to charset_default).

Parameters

  new_charset | = The charset. charset_default = Use operating systems default

## ◆ set_escapement()

void clan::FontDescription::set_escapement | ( | float | value | ) |

Sets the font escapement.

## ◆ set_height()

void clan::FontDescription::set_height | ( | float | value = 20.0f | ) |

Sets the font height.

## ◆ set_line_height()

void clan::FontDescription::set_line_height | ( | float | height | ) |

Sets the distance between each line.

## ◆ set_orientation()

void clan::FontDescription::set_orientation | ( | float | value | ) |

Sets the font orientation.

## ◆ set_style()

void clan::FontDescription::set_style | ( | FontStyle | setting = FontStyle::normal | ) |

Sets the font style.

References clan::normal.

## ◆ set_subpixel()

void clan::FontDescription::set_subpixel | ( | bool | setting = true | ) |

Sets the font subpixel rendering setting (defaults to true).

## ◆ set_weight()

void clan::FontDescription::set_weight | ( | FontWeight | value = FontWeight::normal | ) |

Sets the font weight.

References clan::normal.

## ◆ throw_if_null()

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

Throw an exception if this object is invalid.

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

- font_description.h