Go to the documentation of this file.
41 void drawText(
const std::string& text,
const Point& startPos);
51 Size* textBoxSize =
nullptr);
56 std::string
wrapText(
const std::string& text,
int maxWidth);
68 void calculateGlyphsWidthsAutomatically(
const ImagePtr& image,
const Size& glyphSize);
76 Rect m_glyphsTextureCoords[256];
77 Size m_glyphsSize[256];
void load(const OTMLNodePtr &fontNode)
Load font from otml node.
Size calculateTextRectSize(const std::string &text)
Simulate render and calculate text size.
BitmapFont(const std::string &name)
std::string wrapText(const std::string &text, int maxWidth)
void calculateDrawTextCoords(CoordsBuffer &coordsBuffer, const std::string &text, const Rect &screenCoords, Fw::AlignmentFlag align=Fw::AlignTopLeft)
const TexturePtr & getTexture()
void drawText(const std::string &text, const Point &startPos)
Simple text render starting at startPos.
const Rect * getGlyphsTextureCoords()
const std::vector< Point > & calculateGlyphsPositions(const std::string &text, Fw::AlignmentFlag align=Fw::AlignTopLeft, Size *textBoxSize=nullptr)
Calculate glyphs positions to use on render, also calculates textBoxSize if wanted.
const Size * getGlyphsSize()