Home | All Classes | Grouped Classes | Index | Search

# CL_GlyphBuffer::add

Add elements onto the end of the glyphs vector.

    	CL_GlyphBuffer& add(
    		int x, int y, unsigned int character);

    	CL_GlyphBuffer& add(
    		const CL_GlyphBuffer& other, int center_x = 0, int center_y = 0);

    	CL_GlyphBuffer& add(
    		const CL_GlyphBuffer& other, Range range, int center_x = 0, int center_y = 0);

Parameters:

x, y
  The position to add the characters at (always upper-left positioning inside the buffer).
center_x, center_y
  Where to realign the origin of the input GlyphBuffer to in this GlyphBuffer.
character
  A single character to add without preprocessing.
other
  Another CL_GlyphBuffer to copy all glyphs and data from to the specified position.
range
  The subsection of the other GlyphBuffer to add onto the end of this one

Return value:

A reference to this object, allowing you to chain multiple calls of add() together.

Detailed description:

It's usually more useful and efficient to have ClanLib draw many glyphs into the GlyphBuffer at once using CL_Font::draw_to_gb() or CL_TextStyler::draw_to_gb() than to use this function or the glyphs vector to manually add glyphs.

See also:

CL_Font | CL_GlyphBuffer | CL_TextStyler

Questions or comments, write to the ClanLib mailing list.