ContRap-Core
Public Member Functions

crp::XMLGlyphPrinter Class Reference

Class XMLGlyphPrinter is an abstract glyph printing interface. More...

#include <xmllayout.h>

Public Member Functions

 XMLGlyphPrinter ()
 Default empty constructor of the printer.
virtual ~XMLGlyphPrinter ()
 Releases the memory.
virtual void print_character (int x, int y, const std::string &character)
 Prints a single unicode character at the given position.
virtual void get_size (const std::string &character, double &width, double &height)
 Returns the size of the given unicode character.

Detailed Description

Class XMLGlyphPrinter is an abstract glyph printing interface.

A glyph is an atomic part of printed data, e.g. a letter or an UTF character. More complex glyphs are extensible glyphs. Glyphs are also atomic (leafs) within the resulting block structure of the layout.

An XMLGlyphPrinter implementation provides a library independent way to draw glyphs on some initialized device. You pass the printer to the layouter to draw your output.


Constructor & Destructor Documentation

crp::XMLGlyphPrinter::XMLGlyphPrinter ( ) [inline]

Default empty constructor of the printer.

virtual crp::XMLGlyphPrinter::~XMLGlyphPrinter ( ) [inline, virtual]

Releases the memory.


Member Function Documentation

virtual void crp::XMLGlyphPrinter::get_size ( const std::string &  character,
double &  width,
double &  height 
) [inline, virtual]

Returns the size of the given unicode character.

Parameters:
characterUnicode character
widthThis value is overwritten with the width
heightThis value is overwritten with the height
virtual void crp::XMLGlyphPrinter::print_character ( int  x,
int  y,
const std::string &  character 
) [inline, virtual]

Prints a single unicode character at the given position.

A glyph is printed by calling this method several times a the glyphs positions. The glyph is printed into the rectangle, which starts at (x,y) and extends into the ascending coordinate directions. The width and height of the rectangle for a character can be queried by calling the get_size method.

Parameters:
xX-Coordinate of the drawing point
yY-Coordinate of the drawing point
characterUnicode character to print

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