29 #ifndef CDPL_VIS_FONTMETRICS_HPP
30 #define CDPL_VIS_FONTMETRICS_HPP
139 virtual double getWidth(
const std::string& str)
const = 0;
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.
An interface class with methods that provide information about the metrics of a font.
Definition: FontMetrics.hpp:71
virtual ~FontMetrics()
Virtual destructor.
Definition: FontMetrics.hpp:77
virtual void setFont(const Font &font)=0
Specifies the font for which to obtain the metrics.
virtual double getAscent() const =0
Returns the ascent of the font.
virtual double getWidth(const std::string &str) const =0
Returns the total advance width for the characters in the string str.
virtual double getWidth(char ch) const =0
Returns the advance width for the character ch.
virtual void getBounds(char ch, Rectangle2D &bounds) const =0
Returns the bounding rectangle of the character ch relative to the left-most point on the baseline.
virtual double getHeight() const =0
Returns the height of the font.
virtual double getLeading() const =0
Returns the leading of the font.
virtual double getDescent() const =0
Returns the descent of the font.
virtual void getBounds(const std::string &str, Rectangle2D &bounds) const =0
Returns the total bounding rectangle for the characters in the string str.
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.