30 #ifndef STROKE_FONT_H_ 31 #define STROKE_FONT_H_ 46 typedef std::vector<std::vector<VECTOR2D>*>
GLYPH;
69 bool LoadNewStrokeFont(
const char*
const aNewStrokeFont[],
int aNewStrokeFontSize );
78 void Draw(
const UTF8& aText,
const VECTOR2D& aPosition,
double aRotationAngle );
98 double aGlyphThickness )
const;
165 return std::count( aText.
begin(), aText.
end() - 1,
'\n' ) + 1;
191 #endif // STROKE_FONT_H_ std::vector< std::vector< VECTOR2D > * > GLYPH
An 8 bit string that is assuredly encoded in UTF8, and supplies special conversion support to and fro...
The Cairo implementation of the graphics abstraction layer.
static double GetInterline(double aGlyphHeight)
Compute the distance (interline) between 2 lines of text (for multiline texts).
static const double BOLD_FACTOR
Scale factor for a glyph.
bool LoadNewStrokeFont(const char *const aNewStrokeFont[], int aNewStrokeFontSize)
Load the new stroke font.
static const double ITALIC_TILT
Factor that determines the pitch between 2 lines.
void SetGAL(GAL *aGal)
Changes Graphics Abstraction Layer used for drawing items for a new one.
GAL * m_gal
Pointer to the GAL.
VECTOR2D computeTextLineSize(const UTF8 &aText) const
Compute the X and Y size of a given text.
static const double UNDERLINE_POSITION_FACTOR
Factor that determines relative line width for bold text.
double computeUnderlineVerticalPosition() const
static const double INTERLINE_PITCH_RATIO
VECTOR2D ComputeStringBoundaryLimits(const UTF8 &aText, const VECTOR2D &aGlyphSize, double aGlyphThickness) const
Compute the boundary limits of aText (the bounding box of all shapes).
std::vector< GLYPH * > GLYPH_LIST
void Draw(const UTF8 &aText, const VECTOR2D &aPosition, double aRotationAngle)
Draw a string.
double computeOverbarVerticalPosition() const
Compute the vertical position of an overbar, sometimes used in texts.
double ComputeOverbarVerticalPosition(double aGlyphHeight) const
Compute the vertical position of an overbar, sometimes used in texts.
STROKE_FONT(GAL *aGal)
Constructor.
static const double STROKE_FONT_SCALE
Tilt factor for italic style (the is is the scaling factor on dY relative coordinates to give a tilt ...
void drawSingleLineText(const UTF8 &aText)
Draw a single line of text.
unsigned linesCount(const UTF8 &aText) const
Returns number of lines for a given text.
std::string::const_iterator end() const
static const double OVERBAR_POSITION_FACTOR
const std::vector< BOX2D > * m_glyphBoundingBoxes
Bounding boxes of the glyphs.
std::string::const_iterator begin() const
const GLYPH_LIST * m_glyphs
Glyph list.
BOX2D computeBoundingBox(const GLYPH *aGlyph, double aGlyphWidth) const
Compute the bounding box of a given glyph.
Implement a stroke font drawing.
Abstract interface for drawing on a 2D-surface.