class
AbstractLayouterBase for text layouters.
Contents
Returned by AbstractFont::
Subclassing
Plugin creates private subclass (no need to expose it to end users) and implements doRenderGlyph(). Bounds checking on i
is done automatically in the wrapping renderGlyph() function.
Constructors, destructors, conversion operators
- AbstractLayouter(const AbstractLayouter&) deleted
- Copying is not allowed.
- AbstractLayouter(AbstractLayouter&&) deleted
- Moving is not allowed.
- AbstractLayouter(UnsignedInt glyphCount) protected explicit
- Constructor.
Public functions
- auto operator=(const AbstractLayouter&) -> AbstractLayouter& deleted
- Copying is not allowed.
- auto operator=(const AbstractLayouter&&) -> AbstractLayouter& deleted
- Moving is not allowed.
- auto glyphCount() const -> UnsignedInt
- Count of glyphs in laid out text.
-
auto renderGlyph(UnsignedInt i,
Vector2& cursorPosition,
Range2D& rectangle) -> std::
pair<Range2D, Range2D> - Render glyph.
Protected functions
-
auto doRenderGlyph(UnsignedInt i) -> std::
tuple<Range2D, Range2D, Vector2> pure virtual - Implementation for renderGlyph()
Function documentation
Magnum:: Text:: AbstractLayouter:: AbstractLayouter(UnsignedInt glyphCount) explicit protected
Constructor.
Parameters | |
---|---|
glyphCount | Count of glyphs in laid out text |
std:: pair<Range2D, Range2D> Magnum:: Text:: AbstractLayouter:: renderGlyph(UnsignedInt i,
Vector2& cursorPosition,
Range2D& rectangle)
Render glyph.
Parameters | |
---|---|
i | Glyph index |
cursorPosition | Cursor position |
rectangle | Bounding rectangle |
The function returns pair of quad position and texture coordinates, advances cursorPosition
to next character and updates rectangle
with extended bounds.
std:: tuple<Range2D, Range2D, Vector2> Magnum:: Text:: AbstractLayouter:: doRenderGlyph(UnsignedInt i) pure virtual protected
Implementation for renderGlyph()
Parameters | |
---|---|
i | Glyph index |
Return quad position (relative to current cursor position), texture coordinates and advance to next glyph.