CL_Font_Vector Class Reference
[clanDisplay Font]

Vector font drawing class. More...

#include <font_vector.h>

Inheritance diagram for CL_Font_Vector:
Inheritance graph
[legend]

List of all members.

Public Member Functions

Construction

 CL_Font_Vector ()
 Constructs vector font.
 CL_Font_Vector (const CL_StringRef &typeface_name, int height)
 Constructs a Font Vector.
 CL_Font_Vector (const CL_StringRef &typeface_name, int height, CL_IODevice &file)
 Constructs a Font Vector.
 CL_Font_Vector (const CL_StringRef &typeface_name, int height, const CL_VirtualDirectory &directory)
 Constructs a Font Vector.
 CL_Font_Vector (const CL_FontDescription &desc)
 Constructs a Font Vector.
 CL_Font_Vector (const CL_FontDescription &desc, CL_IODevice &file)
 Constructs a Font Vector.
 CL_Font_Vector (const CL_FontDescription &desc, const CL_VirtualDirectory &directory)
 Constructs a Font Vector.
 ~CL_Font_Vector ()
Attributes

CL_FontProvider_Vector * get_provider () const
 Retrieves the font provider.
Operations

int get_glyph_count (const CL_StringRef &text)
 Returns the amount of glyphs used by text.
CL_GlyphPrimitivesArrayOutline get_glyph_outline (int glyph)
 Gets the glyph outline for a glyph.
CL_GlyphPrimitivesArray get_glyph_triangles (int glyph)
 Gets the glyph triangles for a glyph.
void get_glyphs (const CL_StringRef &text, int *out_glyphs, float *out_interspacing_x, float *out_interspacing_y)
 Find glyph indexes and inter-spacing (x,y) values for text.
void draw_glyphs (CL_GraphicContext &gc, float x, float y, int *glyphs, int length, bool filled=true, float *interspacing_x=0, float *interspacing_y=0, const CL_Colorf &color=CL_Colorf::white)
 Draw glyphs on device context.
CL_Sizef get_glyphs_size (int *glyphs, int length)
 Get glyphs size.
Attributes

bool is_null () const
 Is Null.
Operations

void draw_text (CL_GraphicContext &gc, int x, int y, const CL_StringRef &text, const CL_Colorf &color=CL_Colorf::white)
 Print text on gc.
void draw_text (CL_GraphicContext &gc, float x, float y, const CL_StringRef &text, const CL_Colorf &color=CL_Colorf::white)
 Print text on gc.
void draw_text (CL_GraphicContext &gc, const CL_Pointf &position, const CL_StringRef &text, const CL_Colorf &color=CL_Colorf::white)
 Print text on gc.
void draw_text_ellipsis (CL_GraphicContext &gc, int x, int y, CL_Rect content_box, const CL_StringRef &text, const CL_Colorf &color=CL_Colorf::white)
 Print text on gc adding elipses if it does not fit.
void draw_text_ellipsis (CL_GraphicContext &gc, float x, float y, CL_Rectf content_box, const CL_StringRef &text, const CL_Colorf &color=CL_Colorf::white)
 Print text on gc adding elipses if it does not fit.
void draw_text_ellipsis (CL_GraphicContext &gc, const CL_Pointf &position, CL_Rectf content_box, const CL_StringRef &text, const CL_Colorf &color=CL_Colorf::white)
 Print text on gc adding elipses if it does not fit.
CL_Size get_text_size (CL_GraphicContext &gc, const CL_StringRef &text)
 Calculate size of text string.
CL_Size get_glyph_size (CL_GraphicContext &gc, unsigned int glyph)
 Gets the size of a specified glyph.
CL_FontMetrics get_font_metrics ()
 Retrieves font metrics description for the selected font.
int get_character_index (CL_GraphicContext &gc, const CL_String &text, const CL_Point &point)
 Get the character index at a specified point.

Detailed Description

Vector font drawing class.


Constructor & Destructor Documentation

CL_Font_Vector::CL_Font_Vector (  ) 

Constructs vector font.

CL_Font_Vector::CL_Font_Vector ( const CL_StringRef typeface_name,
int  height 
)

Constructs a Font Vector.

Parameters:
typeface_name = String Ref
height = value
CL_Font_Vector::CL_Font_Vector ( const CL_StringRef typeface_name,
int  height,
CL_IODevice file 
)

Constructs a Font Vector.

Parameters:
typeface_name = String Ref
height = value
file = IODevice
CL_Font_Vector::CL_Font_Vector ( const CL_StringRef typeface_name,
int  height,
const CL_VirtualDirectory directory 
)

Constructs a Font Vector.

Parameters:
typeface_name = String Ref
height = value
directory = Virtual Directory
CL_Font_Vector::CL_Font_Vector ( const CL_FontDescription desc  ) 

Constructs a Font Vector.

Parameters:
desc = Font Description
CL_Font_Vector::CL_Font_Vector ( const CL_FontDescription desc,
CL_IODevice file 
)

Constructs a Font Vector.

Parameters:
desc = Font Description
file = IODevice
CL_Font_Vector::CL_Font_Vector ( const CL_FontDescription desc,
const CL_VirtualDirectory directory 
)

Constructs a Font Vector.

Parameters:
desc = Font Description
directory = Virtual Directory
CL_Font_Vector::~CL_Font_Vector (  ) 

Member Function Documentation

void CL_Font_Vector::draw_glyphs ( CL_GraphicContext gc,
float  x,
float  y,
int *  glyphs,
int  length,
bool  filled = true,
float *  interspacing_x = 0,
float *  interspacing_y = 0,
const CL_Colorf color = CL_Colorf::white 
)

Draw glyphs on device context.

void CL_Font::draw_text ( CL_GraphicContext gc,
int  x,
int  y,
const CL_StringRef text,
const CL_Colorf color = CL_Colorf::white 
) [inherited]

Print text on gc.

Multiline text (seperated by /n) is supported

Parameters:
gc = Graphic Context
x = X position
y = Y position
text = The text to draw
color = The text color
void CL_Font::draw_text ( CL_GraphicContext gc,
float  x,
float  y,
const CL_StringRef text,
const CL_Colorf color = CL_Colorf::white 
) [inherited]

Print text on gc.

Multiline text (seperated by /n) is supported

Parameters:
gc = Graphic Context
x = X position
y = Y position
text = The text to draw
color = The text color
void CL_Font::draw_text ( CL_GraphicContext gc,
const CL_Pointf position,
const CL_StringRef text,
const CL_Colorf color = CL_Colorf::white 
) [inherited]

Print text on gc.

Multiline text (seperated by /n) is supported

Parameters:
gc = Graphic Context
position = Dest position
text = The text to draw
color = The text color
void CL_Font::draw_text_ellipsis ( CL_GraphicContext gc,
int  x,
int  y,
CL_Rect  content_box,
const CL_StringRef text,
const CL_Colorf color = CL_Colorf::white 
) [inherited]

Print text on gc adding elipses if it does not fit.

Multiline text (seperated by /n) is supported

Parameters:
gc = Graphic Context
x = X position
y = Y position
content_box = Rectangle the text is allowed within
text = The text to draw
color = The text color
void CL_Font::draw_text_ellipsis ( CL_GraphicContext gc,
float  x,
float  y,
CL_Rectf  content_box,
const CL_StringRef text,
const CL_Colorf color = CL_Colorf::white 
) [inherited]

Print text on gc adding elipses if it does not fit.

Multiline text (seperated by /n) is supported

Parameters:
gc = Graphic Context
x = X position
y = Y position
content_box = Rectangle the text is allowed within
text = The text to draw
color = The text color
void CL_Font::draw_text_ellipsis ( CL_GraphicContext gc,
const CL_Pointf position,
CL_Rectf  content_box,
const CL_StringRef text,
const CL_Colorf color = CL_Colorf::white 
) [inherited]

Print text on gc adding elipses if it does not fit.

Multiline text (seperated by /n) is supported

Parameters:
gc = Graphic Context
position = Dest position
content_box = Rectangle the text is allowed within
text = The text to draw
color = The text color
int CL_Font::get_character_index ( CL_GraphicContext gc,
const CL_String text,
const CL_Point point 
) [inherited]

Get the character index at a specified point.

Multiline text (seperated by /n) is supported

Parameters:
gc = The Graphic Context
text = The string
point = The point
Returns:
The character index. -1 = Not at specified point
CL_FontMetrics CL_Font::get_font_metrics (  )  [inherited]

Retrieves font metrics description for the selected font.

int CL_Font_Vector::get_glyph_count ( const CL_StringRef text  ) 

Returns the amount of glyphs used by text.

CL_GlyphPrimitivesArrayOutline CL_Font_Vector::get_glyph_outline ( int  glyph  ) 

Gets the glyph outline for a glyph.

CL_Size CL_Font::get_glyph_size ( CL_GraphicContext gc,
unsigned int  glyph 
) [inherited]

Gets the size of a specified glyph.

The size is the increment value to the next glyph

Parameters:
glyph = The glyph to get
Returns:
The size
CL_GlyphPrimitivesArray CL_Font_Vector::get_glyph_triangles ( int  glyph  ) 

Gets the glyph triangles for a glyph.

void CL_Font_Vector::get_glyphs ( const CL_StringRef text,
int *  out_glyphs,
float *  out_interspacing_x,
float *  out_interspacing_y 
)

Find glyph indexes and inter-spacing (x,y) values for text.

CL_Sizef CL_Font_Vector::get_glyphs_size ( int *  glyphs,
int  length 
)

Get glyphs size.

Parameters:
glyphs = value
length = value
Returns:
Sizef
CL_FontProvider_Vector* CL_Font_Vector::get_provider (  )  const

Retrieves the font provider.

Reimplemented from CL_Font.

CL_Size CL_Font::get_text_size ( CL_GraphicContext gc,
const CL_StringRef text 
) [inherited]

Calculate size of text string.

Multiline text (seperated by /n) is supported

Note: The height also includes whitespace (to give the maximum font height), so "." and "X" returns the same height.
The width is the pixel width

The size is the increment value to the next glyph

bool CL_Font::is_null (  )  const [inherited]

Is Null.

Returns:
true = null

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