Renders text into an image using a TrueType font. More...
#include <fontpainter.h>
Public Member Functions | |
| FontPainter () | |
| Constructs a FontPainter with no paint engine or font set. | |
| ~FontPainter () | |
| Destroys the FontPainter and releases font resources. | |
| void | setPaintEngine (const PaintEngine &val) |
| Sets the paint engine used for rendering. | |
| void | setFontFilename (const String &val) |
| Sets the path to the TrueType font file. | |
| bool | drawText (const String &text, int x, int y, int pointSize=12) const |
| Draws text at the specified position. | |
| int | measureText (const String &text, int pointSize=12) const |
| Measures the pixel width of a text string without drawing it. | |
Renders text into an image using a TrueType font.
Uses a PaintEngine to draw glyphs loaded from a TrueType font file. Set the paint engine and font filename before calling drawText().
Draws text at the specified position.
| text | The text string to render. |
| x | The x coordinate of the text origin. |
| y | The y coordinate of the text origin (baseline). |
| pointSize | The font size in points (default 12). |
Measures the pixel width of a text string without drawing it.
| text | The text string to measure. |
| pointSize | The font size in points (default 12). |
Sets the path to the TrueType font file.
| val | The filename or path of the font to load. |
|
inline |
Sets the paint engine used for rendering.
| val | The PaintEngine to use for drawing operations. |