golib  0.5
goPlot::TextTraits Class Reference

Text properties. Contains colour and font. More...

#include <texttraits.h>

Public Member Functions

 TextTraits (const TextTraits &other)
 
TextTraitsoperator= (const TextTraits &other)
 
void setContext (cairo_t *cr)
 
void apply ()
 Applies the properties to the current context. Sets colour and creates and sets a current font description.
 
const RGBAcolour () const
 Gets the colour. More...
 
void setColour (const RGBA &c)
 Sets the colour. More...
 
const std::string font () const
 Gets the textual font description. More...
 
void setFont (const char *f)
 Sets the textual font description. More...
 
PangoLayout * layout ()
 Gets the pango layout for this text object. More...
 
const PangoLayout * layout () const
 Gets the pango layout for this text object. More...
 

Detailed Description

Text properties. Contains colour and font.

Member Function Documentation

◆ colour()

const RGBA & goPlot::TextTraits::colour ( ) const

Gets the colour.

Returns
Font colour.

◆ font()

const std::string goPlot::TextTraits::font ( ) const

Gets the textual font description.

Returns
Font description text.

◆ layout() [1/2]

PangoLayout * goPlot::TextTraits::layout ( )

Gets the pango layout for this text object.

Probably only needed in the drawing code.

Returns
Pointer to PangoLayout

◆ layout() [2/2]

const PangoLayout * goPlot::TextTraits::layout ( ) const

Gets the pango layout for this text object.

Probably only needed in the drawing code.

Returns
Pointer to PangoLayout

◆ setColour()

void goPlot::TextTraits::setColour ( const RGBA c)

Sets the colour.

Parameters
cFont colour.

◆ setFont()

void goPlot::TextTraits::setFont ( const char *  f)

Sets the textual font description.

The description is passed to pango. See the documentation of pango_font_description_from_string().

Parameters
fTextual font description.

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