CL_FontMetrics Class Reference
[clanDisplay Font]

Font metrics class. More...

#include <font_metrics.h>

List of all members.

Public Member Functions

Construction

 CL_FontMetrics ()
 Constructs a null instance.
 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.
void throw_if_null () const
 Throw an exception if this object is invalid.
float get_height () const
 Returns the height of the font.
float get_ascent () const
 Returns the font ascender.
float get_descent () const
 Returns the font descender.
float get_internal_leading () const
 Returns the amount of leading (space) inside the bounds set by the get_height() function.
float get_external_leading () const
 Returns the amount of extra leading (space) that the application adds between rows.
float get_average_character_width () const
 Returns the average width of characters in the font.
float get_max_character_width () const
 Returns the width of the widest character in the font.
float get_weight () const
 Returns the weight of the font.
float get_overhang () const
 Returns the extra width per string that may be added to some synthesized fonts.
float get_digitized_aspect_x () const
 Returns the horizontal aspect of the device for which the font was designed.
float get_digitized_aspect_y () const
 Returns the vertical aspect of the device for which the font was designed.
CL_String::char_type get_first_char () const
 Returns the value of the first character defined in the font.
CL_String::char_type get_last_char () const
 Returns the value of the last character defined in the font.
CL_String::char_type get_default_char () const
 Returns the value of the character to be substituted for characters not in the font.
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.
bool is_italic () const
 Returns true if the font is italic.
bool is_underlined () const
 Returns true if the font is underlined.
bool is_struck_out () const
 Returns true if the font is struck out.
bool is_fixed_pitch () const
 Returns true if the font is a mono space font.
Operations

void set_height (float value)
 Set the height of the font.
void set_ascent (float value)
 Set the font ascender.
void set_descent (float value)
 Set the font descender.
void set_internal_leading (float value)
 Set the amount of leading (space) inside the bounds set by the set_height() function.
void set_external_leading (float value)
 Set the amount of extra leading (space) that the application adds between rows.
void set_average_character_width (float value)
 Set the average width of characters in the font.
void set_max_character_width (float value)
 Set the width of the widest character in the font.
void set_weight (float value)
 Set the weight of the font.
void set_overhang (float value)
 Set the extra width per string that may be added to some synthesized fonts.
void set_digitized_aspect_x (float value)
 Set the horizontal aspect of the device for which the font was designed.
void set_digitized_aspect_y (float value)
 Set the vertical aspect of the device for which the font was designed.
void set_italic (bool value)
 Set if the font is italic.
void set_underlined (bool value)
 Set if the font is underlined.
void set_struck_out (bool value)
 Set if the font is struck out.
void set_fixed_pitch (bool value)
 Set if the font is a mono space font.

Detailed Description

Font metrics class.


Constructor & Destructor Documentation

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 (  ) 

Member Function Documentation

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.

bool CL_FontMetrics::is_null (  )  const [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.

Parameters:
value = The ascent
void CL_FontMetrics::set_average_character_width ( float  value  ) 

Set the average width of characters in the font.

Parameters:
value = The average_character_width
void CL_FontMetrics::set_descent ( float  value  ) 

Set the font descender.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
value = The external_leading
void CL_FontMetrics::set_fixed_pitch ( bool  value  ) 

Set if the font is a mono space font.

Parameters:
value = true if fixed_pitch
void CL_FontMetrics::set_height ( float  value  ) 

Set the height of the font.

Parameters:
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.

Parameters:
value = The internal_leading
void CL_FontMetrics::set_italic ( bool  value  ) 

Set if the font is italic.

Parameters:
value = true if italic
void CL_FontMetrics::set_max_character_width ( float  value  ) 

Set the width of the widest character in the font.

Parameters:
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.

Parameters:
value = The overhang
void CL_FontMetrics::set_struck_out ( bool  value  ) 

Set if the font is struck out.

Parameters:
value = true if struck_out
void CL_FontMetrics::set_underlined ( bool  value  ) 

Set if the font is underlined.

Parameters:
value = true if underlined
void CL_FontMetrics::set_weight ( float  value  ) 

Set the weight of the font.

Parameters:
value = The weight
void CL_FontMetrics::throw_if_null (  )  const

Throw an exception if this object is invalid.


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