golib  0.5
goPlot::Object2DText Class Reference

2D text drawing class. Uses pango with cairo. More...

#include <object2dtext.h>

Public Member Functions

 Object2DText (const char *c)
 
 Object2DText (const goPlot::Object2DText &other)
 
 operator const char * () const
 
goPlot::Object2DTextoperator= (const char *t)
 
goPlot::Object2DTextoperator= (const goPlot::Object2DText &other)
 
std::string & string ()
 
const std::string & string () const
 
goPlot::TextTraitstraits ()
 
const goPlot::TextTraitstraits () const
 
goPlot::real x () const
 
goPlot::real y () const
 
goPlot::real relDx () const
 
goPlot::real relDy () const
 
void setPosition (goPlot::real x, goPlot::real y, goPlot::real rel_dx=0.0, goPlot::real rel_dy=0.0)
 Sets position of text. More...
 
virtual void setContext (cairo_t *context)
 
virtual void draw ()
 
void addToPath ()
 
- Public Member Functions inherited from goPlot::Object2D
const Trafo2Dtransform () const
 
void setTransform (const Trafo2D &T)
 
cairo_t * context ()
 
const cairo_t * context () const
 
bool visible () const
 
void setVisible (bool t)
 
void applyTransform (cairo_t *cr)
 

Detailed Description

2D text drawing class. Uses pango with cairo.

A position can be set using setPosition() (see there). The text is then drawn with the properties in TextTraits accessible by traits().

Bug:
FIXME: rel_x|y funktioniert nicht mit markup Text!

Member Function Documentation

◆ addToPath()

void goPlot::Object2DText::addToPath ( )

Used to find out borders with getBorderHint ()

◆ setPosition()

void goPlot::Object2DText::setPosition ( goPlot::real  x,
goPlot::real  y,
goPlot::real  rel_dx = 0.0,
goPlot::real  rel_dy = 0.0 
)

Sets position of text.

Sets the text position at (x,y) and moves the text in (w * rel_dx, h * rel_dy) direction, where w and h are the text's width and height, respectively. You can use this e.g. for alignment. Note that the motion is done before transformations, so it gets transformed.

Parameters
xx position.
yy position.
rel_dxrelative movement in x direction
rel_dyrelative movement in y direction

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