|
golib
0.5
|
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::Object2DText & | operator= (const char *t) |
| goPlot::Object2DText & | operator= (const goPlot::Object2DText &other) |
| std::string & | string () |
| const std::string & | string () const |
| goPlot::TextTraits & | traits () |
| const goPlot::TextTraits & | traits () 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 Trafo2D & | transform () 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) |
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().
| void goPlot::Object2DText::addToPath | ( | ) |
Used to find out borders with getBorderHint ()
| 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.
| x | x position. |
| y | y position. |
| rel_dx | relative movement in x direction |
| rel_dy | relative movement in y direction |