ClanLib
2.3.7
|
Font metrics class. More...
#include <font_metrics.h>
Public Member Functions | |
Construction | |
CL_FontMetrics () | |
Constructs a null instance. More... | |
CL_FontMetrics (float height, float ascent=0.0f, float descent=0.0f, float internal_leading=0.0f, float external_leading=0.0f, float average_character_width=0.0f, float max_character_width=0.0f, float weight=0.0f, float overhang=0.0f, float digitized_aspect_x=0.0f, float digitized_aspect_y=0.0f, bool italic=false, bool underlined=false, bool struck_out=false, bool fixed_pitch=false) | |
~CL_FontMetrics () | |
Attributes | |
bool | is_null () const |
Returns true if this object is invalid. More... | |
void | throw_if_null () const |
Throw an exception if this object is invalid. More... | |
float | get_height () const |
Returns the height of the font. More... | |
float | get_ascent () const |
Returns the font ascender. More... | |
float | get_descent () const |
Returns the font descender. More... | |
float | get_internal_leading () const |
Returns the amount of leading (space) inside the bounds set by the get_height() function. More... | |
float | get_external_leading () const |
Returns the amount of extra leading (space) that the application adds between rows. More... | |
float | get_average_character_width () const |
Returns the average width of characters in the font. More... | |
float | get_max_character_width () const |
Returns the width of the widest character in the font. More... | |
float | get_weight () const |
Returns the weight of the font. More... | |
float | get_overhang () const |
Returns the extra width per string that may be added to some synthesized fonts. More... | |
float | get_digitized_aspect_x () const |
Returns the horizontal aspect of the device for which the font was designed. More... | |
float | get_digitized_aspect_y () const |
Returns the vertical aspect of the device for which the font was designed. More... | |
CL_String::char_type | get_first_char () const |
Returns the value of the first character defined in the font. More... | |
CL_String::char_type | get_last_char () const |
Returns the value of the last character defined in the font. More... | |
CL_String::char_type | get_default_char () const |
Returns the value of the character to be substituted for characters not in the font. More... | |
CL_String::char_type | get_word_break_char () const |
Returns the value of the character that will be used to define word breaks for text justification. More... | |
bool | is_italic () const |
Returns true if the font is italic. More... | |
bool | is_underlined () const |
Returns true if the font is underlined. More... | |
bool | is_struck_out () const |
Returns true if the font is struck out. More... | |
bool | is_fixed_pitch () const |
Returns true if the font is a mono space font. More... | |
Operations | |
void | set_height (float value) |
Set the height of the font. More... | |
void | set_ascent (float value) |
Set the font ascender. More... | |
void | set_descent (float value) |
Set the font descender. More... | |
void | set_internal_leading (float value) |
Set the amount of leading (space) inside the bounds set by the set_height() function. More... | |
void | set_external_leading (float value) |
Set the amount of extra leading (space) that the application adds between rows. More... | |
void | set_average_character_width (float value) |
Set the average width of characters in the font. More... | |
void | set_max_character_width (float value) |
Set the width of the widest character in the font. More... | |
void | set_weight (float value) |
Set the weight of the font. More... | |
void | set_overhang (float value) |
Set the extra width per string that may be added to some synthesized fonts. More... | |
void | set_digitized_aspect_x (float value) |
Set the horizontal aspect of the device for which the font was designed. More... | |
void | set_digitized_aspect_y (float value) |
Set the vertical aspect of the device for which the font was designed. More... | |
void | set_italic (bool value) |
Set if the font is italic. More... | |
void | set_underlined (bool value) |
Set if the font is underlined. More... | |
void | set_struck_out (bool value) |
Set if the font is struck out. More... | |
void | set_fixed_pitch (bool value) |
Set if the font is a mono space font. More... | |
Font metrics class.
CL_FontMetrics::CL_FontMetrics | ( | ) |
Constructs a null instance.
CL_FontMetrics::CL_FontMetrics | ( | float | height, |
float | ascent = 0.0f , |
||
float | descent = 0.0f , |
||
float | internal_leading = 0.0f , |
||
float | external_leading = 0.0f , |
||
float | average_character_width = 0.0f , |
||
float | max_character_width = 0.0f , |
||
float | weight = 0.0f , |
||
float | overhang = 0.0f , |
||
float | digitized_aspect_x = 0.0f , |
||
float | digitized_aspect_y = 0.0f , |
||
bool | italic = false , |
||
bool | underlined = false , |
||
bool | struck_out = false , |
||
bool | fixed_pitch = false |
||
) |
CL_FontMetrics::~CL_FontMetrics | ( | ) |
float CL_FontMetrics::get_ascent | ( | ) | const |
Returns the font ascender.
float CL_FontMetrics::get_average_character_width | ( | ) | const |
Returns the average width of characters in the font.
The average width is generally defined as the width of the letter x. The value does not include the overhang required for bold or italic characters.
CL_String::char_type CL_FontMetrics::get_default_char | ( | ) | const |
Returns the value of the character to be substituted for characters not in the font.
float CL_FontMetrics::get_descent | ( | ) | const |
Returns the font descender.
float CL_FontMetrics::get_digitized_aspect_x | ( | ) | const |
Returns the horizontal aspect of the device for which the font was designed.
float CL_FontMetrics::get_digitized_aspect_y | ( | ) | const |
Returns the vertical aspect of the device for which the font was designed.
float CL_FontMetrics::get_external_leading | ( | ) | const |
Returns the amount of extra leading (space) that the application adds between rows.
CL_String::char_type CL_FontMetrics::get_first_char | ( | ) | const |
Returns the value of the first character defined in the font.
float CL_FontMetrics::get_height | ( | ) | const |
Returns the height of the font.
float CL_FontMetrics::get_internal_leading | ( | ) | const |
Returns the amount of leading (space) inside the bounds set by the get_height() function.
CL_String::char_type CL_FontMetrics::get_last_char | ( | ) | const |
Returns the value of the last character defined in the font.
float CL_FontMetrics::get_max_character_width | ( | ) | const |
Returns the width of the widest character in the font.
float CL_FontMetrics::get_overhang | ( | ) | const |
Returns the extra width per string that may be added to some synthesized fonts.
float CL_FontMetrics::get_weight | ( | ) | const |
Returns the weight of the font.
CL_String::char_type CL_FontMetrics::get_word_break_char | ( | ) | const |
Returns the value of the character that will be used to define word breaks for text justification.
bool CL_FontMetrics::is_fixed_pitch | ( | ) | const |
Returns true if the font is a mono space font.
bool CL_FontMetrics::is_italic | ( | ) | const |
Returns true if the font is italic.
|
inline |
Returns true if this object is invalid.
bool CL_FontMetrics::is_struck_out | ( | ) | const |
Returns true if the font is struck out.
bool CL_FontMetrics::is_underlined | ( | ) | const |
Returns true if the font is underlined.
void CL_FontMetrics::set_ascent | ( | float | value) |
Set the font ascender.
value | = The ascent |
void CL_FontMetrics::set_average_character_width | ( | float | value) |
Set the average width of characters in the font.
value | = The average_character_width |
void CL_FontMetrics::set_descent | ( | float | value) |
Set the font descender.
value | = The descent |
void CL_FontMetrics::set_digitized_aspect_x | ( | float | value) |
Set the horizontal aspect of the device for which the font was designed.
value | = The digitized_aspect_x |
void CL_FontMetrics::set_digitized_aspect_y | ( | float | value) |
Set the vertical aspect of the device for which the font was designed.
value | = The digitized_aspect_y |
void CL_FontMetrics::set_external_leading | ( | float | value) |
Set the amount of extra leading (space) that the application adds between rows.
value | = The external_leading |
void CL_FontMetrics::set_fixed_pitch | ( | bool | value) |
Set if the font is a mono space font.
value | = true if fixed_pitch |
void CL_FontMetrics::set_height | ( | float | value) |
Set the height of the font.
value | = The height |
void CL_FontMetrics::set_internal_leading | ( | float | value) |
Set the amount of leading (space) inside the bounds set by the set_height() function.
value | = The internal_leading |
void CL_FontMetrics::set_italic | ( | bool | value) |
Set if the font is italic.
value | = true if italic |
void CL_FontMetrics::set_max_character_width | ( | float | value) |
Set the width of the widest character in the font.
value | = The max_character_width |
void CL_FontMetrics::set_overhang | ( | float | value) |
Set the extra width per string that may be added to some synthesized fonts.
value | = The overhang |
void CL_FontMetrics::set_struck_out | ( | bool | value) |
Set if the font is struck out.
value | = true if struck_out |
void CL_FontMetrics::set_underlined | ( | bool | value) |
Set if the font is underlined.
value | = true if underlined |
void CL_FontMetrics::set_weight | ( | float | value) |
Set the weight of the font.
value | = The weight |
void CL_FontMetrics::throw_if_null | ( | ) | const |
Throw an exception if this object is invalid.