CUGL 2.1
Cornell University Game Library
|
#include <CUGlyphRun.h>
Public Member Functions | |
GlyphRun () | |
~GlyphRun () | |
void | dispose () |
bool | contains (Uint32 glyph) const |
bool | contains (const std::vector< Uint32 > &glyphs) const |
bool | contains (const std::string glyphs) |
Static Public Member Functions | |
static std::shared_ptr< GlyphRun > | alloc () |
Public Attributes | |
std::unordered_set< Uint32 > | contents |
Mesh< SpriteVertex2 > | mesh |
std::shared_ptr< Texture > | texture |
This class represents a single glyph run for a rendered text string
A glyph run is a mesh for a specific font atlas. In order to scalably support unicode, fonts often have mutliple atlases, each composed of a disjoint set of glyphs. When we render a string of text, we break it up into multiple glyph runs, one for each relevant atlas. This allows for efficient rendering of the text with minimal texture switching.
|
inline |
Creates an empty glyp run.
NEVER USE A CONSTRUCTOR WITH NEW. If you want to allocate an object on the heap, use one of the static constructors instead.
|
inline |
Deletes this glyph run, disposing of all resources.
|
inlinestatic |
Returns a newly allocated glyph run
The glyphy run is empty. Access its fields to initialize it.
|
inline |
Returns true if this glyph run contains all of the given glyphs.
The string is converted into a glyph sequence using UTF8 decoding. If just one glyph in the given vector is missing, this returns false. This method depends on the value of the attribute contents. It is the reponsibility of the user to ensure that contents matches the data in mesh.
glyphs | The glyphs as a UTF8 string |
|
inline |
Returns true if this glyph run contains all of the given glyphs.
If just one glyph in the given vector is missing, this returns false. This method depends on the value of the attribute contents. It is the reponsibility of the user to ensure that contents matches the data in mesh.
glyphs | The glyph unicode values |
|
inline |
Returns true if this glyph run contains the given glyph.
This method depends on the value of the attribute contents. It is the reponsibility of the user to ensure that contents matches the data in mesh.
glyph | The glyph unicode value |
|
inline |
Deletes the glyph run resources.
std::unordered_set<Uint32> cugl::GlyphRun::contents |
The glyphs represented in this glyph run
Mesh<SpriteVertex2> cugl::GlyphRun::mesh |
The mesh for the individual glyphs
std::shared_ptr<Texture> cugl::GlyphRun::texture |
The font texture necessary to render the mesh