libpromeki main
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
fontpainter.h
Go to the documentation of this file.
1
8#pragma once
9
11#include <promeki/core/string.h>
13
15
24 public:
27
30
36 _paintEngine = val;
37 return;
38 }
39
44 void setFontFilename(const String &val) {
45 _fontFilename = val;
46 return;
47 }
48
57 bool drawText(const String &text, int x, int y, int pointSize = 12) const;
58
65 int measureText(const String &text, int pointSize = 12) const;
66
67 private:
68 PaintEngine _paintEngine;
69 String _fontFilename;
70};
71
73
Renders text into an image using a TrueType font.
Definition fontpainter.h:23
void setPaintEngine(const PaintEngine &val)
Sets the paint engine used for rendering.
Definition fontpainter.h:35
bool drawText(const String &text, int x, int y, int pointSize=12) const
Draws text at the specified position.
FontPainter()
Constructs a FontPainter with no paint engine or font set.
void setFontFilename(const String &val)
Sets the path to the TrueType font file.
Definition fontpainter.h:44
int measureText(const String &text, int pointSize=12) const
Measures the pixel width of a text string without drawing it.
~FontPainter()
Destroys the FontPainter and releases font resources.
Dynamic array container wrapping std::vector.
Definition list.h:40
2D drawing engine for rendering primitives onto images.
Definition paintengine.h:30
Encoding-aware string class with copy-on-write semantics.
Definition string.h:35
#define PROMEKI_NAMESPACE_BEGIN
Starts a promeki namespace block.
Definition namespace.h:14
#define PROMEKI_NAMESPACE_END
Ends a promeki namespace block.
Definition namespace.h:19