29 #ifndef CDPL_VIS_CAIROFONTMETRICS_HPP
30 #define CDPL_VIS_CAIROFONTMETRICS_HPP
136 std::unique_ptr<CairoExtents> cairoExtents;
struct _cairo _cairo_t
Definition: CairoFontMetrics.hpp:39
Definition of class CDPL::Vis::CairoPointer.
Definition of class CDPL::Vis::FontMetrics.
Definition of the preprocessor macro CDPL_VIS_API.
#define CDPL_VIS_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Implements the FontMetrics interface for the Cairo rendering backend.
Definition: CairoFontMetrics.hpp:54
CairoFontMetrics(const CairoPointer< cairo_t > &cairo_ctxt)
Constructs a font metrics object that operates on the Cairo drawing context specified by cairo_ctxt.
double getLeading() const
Returns the leading of the current font.
double getDescent() const
Returns the descent of the current font.
void setFont(const Font &font)
Specifies the font to use for the calculation of text metrics.
void getBounds(const std::string &str, Rectangle2D &bounds) const
Computes the tight bounding rectangle of the rendered string str in the current font.
CairoFontMetrics(const CairoFontMetrics &)=delete
~CairoFontMetrics()
Destructor.
CairoFontMetrics & operator=(const CairoFontMetrics &)=delete
double getAscent() const
Returns the ascent of the current font.
double getWidth(const std::string &str) const
Returns the total advance width of the rendered string str in the current font.
double getWidth(char ch) const
Returns the advance width of the rendered character ch in the current font.
void getBounds(char ch, Rectangle2D &bounds) const
Computes the tight bounding rectangle of the rendered character ch in the current font.
double getHeight() const
Returns the height of the current font.
Interface providing methods for querying information about the metrics of a font.
Definition: FontMetrics.hpp:71
Specifies a font for drawing text.
Definition: Font.hpp:54
Specifies an axis aligned rectangular area in 2D space.
Definition: Rectangle2D.hpp:51
The namespace of the Chemical Data Processing Library.