GlyphRun contains the memory structures that are needed to render a text string.
More...
#include <kanzi/core.ui/text/glyph_run.hpp>
|
| void | allocateClippingCoordinates () |
| | Allocates the space for the clipping coordinates. More...
|
| |
| void | draw (Renderer3D &renderer, GlyphCache &glyphCache, bool twoPass, const Material &material) |
| | Renders the glyph run. More...
|
| |
| RectangleFloat | getBoundingRectangle () const |
| | Returns the bounding box for the whole glyph run, with clipping. More...
|
| |
| RectangleFloat | getCharacterBounds (unsigned int glyphRunIndex) const |
| | Returns the unclipped bounding box for the given glyph, as set by setCharacterBounds(). More...
|
| |
| | GlyphRun (Domain *domain, unsigned int capacity) |
| | Constructs a glyph run with given maximum capacity. More...
|
| |
| void | setCharacterBounds (unsigned int glyphRunIndex, float left, float top, float right, float bottom) |
| | Sets the unclipped bounding box for a glyph at the given index. More...
|
| |
| void | setClippingCoordinates (unsigned int glyphRunIndex, float left, float top, float right, float bottom) |
| | Sets the clipping coordinates for a glyph at the given index. More...
|
| |
| void | setGlyph (unsigned int glyphRunIndex, const GlyphKey &glyphKey) |
| | Sets the font glyph index for the given glyph. More...
|
| |
| void | setLength (unsigned int length) |
| | Sets the actual length of the glyph run. More...
|
| |
| void | setVertexCoordinates (unsigned int glyphRunIndex, float left, float top, float right, float bottom) |
| | Sets the vertex coordinates for the given index, based on the given edges. More...
|
| |
| | ~GlyphRun () |
| | Destructor. More...
|
| |
GlyphRun contains the memory structures that are needed to render a text string.
| kanzi::GlyphRun::GlyphRun |
( |
Domain * |
domain, |
|
|
unsigned int |
capacity |
|
) |
| |
|
explicit |
Constructs a glyph run with given maximum capacity.
- Parameters
-
| domain | Domain to use. |
| capacity | Defines the maximum amount of glyphs that can be included in the run. |
| kanzi::GlyphRun::~GlyphRun |
( |
| ) |
|
Renders the glyph run.
- Parameters
-
| renderer | Renderer to use for drawing. |
| glyphCache | Glyph cache from which to fetch the glyph bitmaps. |
| twoPass | True for separate color and depth render passes, false for a single pass. |
| material | Material whose shader program to use for rendering. |
| void kanzi::GlyphRun::setVertexCoordinates |
( |
unsigned int |
glyphRunIndex, |
|
|
float |
left, |
|
|
float |
top, |
|
|
float |
right, |
|
|
float |
bottom |
|
) |
| |
Sets the vertex coordinates for the given index, based on the given edges.
- Parameters
-
| glyphRunIndex | Index of the glyph in the glyph run. |
| left | Left edge x axis coordinate. |
| top | Top edge y axis coordinate. |
| right | Right edge x axis coordinate. |
| bottom | Bottom edge y axis coordinate. |
| void kanzi::GlyphRun::setCharacterBounds |
( |
unsigned int |
glyphRunIndex, |
|
|
float |
left, |
|
|
float |
top, |
|
|
float |
right, |
|
|
float |
bottom |
|
) |
| |
Sets the unclipped bounding box for a glyph at the given index.
Used to calculate final clipped vertex coordinates.
- Parameters
-
| glyphRunIndex | Index of the glyph in the glyph run. |
| left | Left edge x axis coordinate. |
| top | Top edge y axis coordinate. |
| right | Right edge x axis coordinate. |
| bottom | Bottom edge y axis coordinate. |
| void kanzi::GlyphRun::setClippingCoordinates |
( |
unsigned int |
glyphRunIndex, |
|
|
float |
left, |
|
|
float |
top, |
|
|
float |
right, |
|
|
float |
bottom |
|
) |
| |
Sets the clipping coordinates for a glyph at the given index.
For each quad there are 4 floats in range[0, 1]: left, right, bottom, and top. For example, a left value of 0.1 and a right value of 0.25 means that one tenth of the glyph is being clipped from the left side and a quarter of the glyph is being clipped from the right side.
- Parameters
-
| glyphRunIndex | Index of the glyph in the glyph run. |
| left | Left edge clipping amount. |
| top | Top edge clipping amount. |
| right | Right edge clipping amount. |
| bottom | Bottom edge clipping amount. |
| void kanzi::GlyphRun::setGlyph |
( |
unsigned int |
glyphRunIndex, |
|
|
const GlyphKey & |
glyphKey |
|
) |
| |
Sets the font glyph index for the given glyph.
Use this function to retrieve texture coordinates.
- Parameters
-
| glyphRunIndex | Index of the glyph in the glyph run. |
| glyphKey | GlyphKey of the glyph in the used font. |
| void kanzi::GlyphRun::setLength |
( |
unsigned int |
length | ) |
|
Sets the actual length of the glyph run.
- Parameters
-
| length | Length of the run. The length must be smaller than or equal to the available length. |
| void kanzi::GlyphRun::allocateClippingCoordinates |
( |
| ) |
|
Allocates the space for the clipping coordinates.
Returns the bounding box for the whole glyph run, with clipping.
- Returns
- Bounding box containing all the glyphs.
| RectangleFloat kanzi::GlyphRun::getCharacterBounds |
( |
unsigned int |
glyphRunIndex | ) |
const |
Returns the unclipped bounding box for the given glyph, as set by setCharacterBounds().
- Parameters
-
| glyphRunIndex | Index of the glyph in the glyph run. |
- Returns
- Bounding box for the glyph.
The documentation for this class was generated from the following file: