|
nCine 2025.10.r510-151873a
A cross-platform 2D game engine
|
A class holding the font and glyphs information needed to render text. More...
#include <Font.h>


Public Types | |
| enum | RenderMode { GLYPH_IN_ALPHA , GLYPH_IN_RED , GLYPH_SPRITE } |
| The available modes for text nodes rendering. More... | |
Public Types inherited from ncine::Object | |
| enum class | ObjectType { BASE = 0 , TEXTURE , SHADER , SCENENODE , SPRITE , MESH_SPRITE , ANIMATED_SPRITE , PARTICLE , PARTICLE_SYSTEM , FONT , TEXTNODE , AUDIOBUFFER , AUDIOBUFFER_PLAYER , AUDIOSTREAM_PLAYER } |
| Object types. | |
Public Member Functions | |
| Font () | |
| Constructs an empty font object with no glyphs nor kerning pairs. | |
| Font (const char *fntBufferName, const unsigned char *fntBufferPtr, unsigned long int fntBufferSize, const char *texFilename) | |
Constructs the object from an AngelCode's FNT memory buffer and a texture. | |
| Font (const char *fntBufferName, const unsigned char *fntBufferPtr, unsigned long int fntBufferSize, const char *texBufferName, const unsigned char *texBufferPtr, unsigned long int texBufferSize) | |
Constructs the object from an AngelCode's FNT memory buffer and a texture memory buffer. | |
| Font (const char *fntBufferName, const unsigned char *fntBufferPtr, unsigned long int fntBufferSize, Texture *texture) | |
Constructs the object from an AngelCode's FNT memory buffer and a shared texture object. | |
| Font (const char *fntFilename) | |
Constructs the object from an AngelCode's FNT file. | |
| Font (const char *fntFilename, const char *texFilename) | |
Constructs the object from an AngelCode's FNT file and a texture file. | |
| Font (const char *fntFilename, Texture *texture) | |
Constructs the object from an AngelCode's FNT file and a shared texture object. | |
| Font (Font &&) | |
| Default move constructor. | |
| Font & | operator= (Font &&) |
| Default move assignment operator. | |
| bool | loadFromMemory (const char *fntBufferName, const unsigned char *fntBufferPtr, unsigned long int fntBufferSize, const char *texFilename) |
| bool | loadFromMemory (const char *fntBufferName, const unsigned char *fntBufferPtr, unsigned long int fntBufferSize, const char *texBufferName, const unsigned char *texBufferPtr, unsigned long int texBufferSize) |
| bool | loadFromMemory (const char *fntBufferName, const unsigned char *fntBufferPtr, unsigned long int fntBufferSize, Texture *texture) |
| bool | loadFromFile (const char *fntFilename) |
| bool | loadFromFile (const char *fntFilename, const char *texFilename) |
| bool | loadFromFile (const char *fntFilename, Texture *texture) |
| const Texture * | texture () const |
| Returns the constant texture object in use by the font. | |
| Texture * | texture () |
| Returns the texture object in use by the font. | |
| bool | setTexture (Texture *texture) |
| Sets a new shared texture object without modifying any glyphs or kerning data. | |
| unsigned int | lineHeight () const |
| Returns the font line height. | |
| unsigned int | base () const |
| Returns the font base. | |
| Vector2i | textureSize () const |
| Returns the texture atlas size. | |
| unsigned int | numGlyphs () const |
| Returns the number of glyphs. | |
| unsigned int | numKernings () const |
| Returns the number of kerning pairs. | |
| const FontGlyph * | glyph (unsigned int glyphId) const |
| Returns a constant pointer to a glyph. | |
| RenderMode | renderMode () const |
| Returns the mode detected by the font to render text nodes. | |
Public Member Functions inherited from ncine::Object | |
| Object (ObjectType type) | |
| Constructs an object with a specified type and adds it to the index. | |
| Object (ObjectType type, const char *name) | |
| Constructs an object with a specified type and name and adds it to the index. | |
| virtual | ~Object () |
| Removes an object from the index and then destroys it. | |
| Object (Object &&other) | |
| Move constructor. | |
| Object & | operator= (Object &&other) |
| Move assignment operator. | |
| unsigned int | id () const |
| Returns the object identification number. | |
| ObjectType | type () const |
| Returns the object type (RTTI) | |
| const char * | name () const |
| Returns the object name. | |
| void | setName (const char *name) |
| Sets the object name. | |
Static Public Member Functions | |
| static ObjectType | sType () |
Static Public Member Functions inherited from ncine::Object | |
| static ObjectType | sType () |
| Static method to return class type. | |
| template<class T > | |
| static T * | fromId (unsigned int id) |
| Returns a casted pointer to the object with the specified id, if any exists. | |
Additional Inherited Members | |
Static Public Attributes inherited from ncine::Object | |
| static const unsigned int | MaxNameLength = 128 |
| Maximum length for an object name. | |
Protected Member Functions inherited from ncine::Object | |
| Object (const Object &other) | |
| Protected copy constructor used to clone objects. | |
Protected Attributes inherited from ncine::Object | |
| ObjectType | type_ |
| Object type. | |
A class holding the font and glyphs information needed to render text.
| ncine::Font::Font | ( | const char * | fntBufferName, |
| const unsigned char * | fntBufferPtr, | ||
| unsigned long int | fntBufferSize, | ||
| const char * | texFilename | ||
| ) |
Constructs the object from an AngelCode's FNT memory buffer and a texture.
| ncine::Font::Font | ( | const char * | fntBufferName, |
| const unsigned char * | fntBufferPtr, | ||
| unsigned long int | fntBufferSize, | ||
| const char * | texBufferName, | ||
| const unsigned char * | texBufferPtr, | ||
| unsigned long int | texBufferSize | ||
| ) |
Constructs the object from an AngelCode's FNT memory buffer and a texture memory buffer.
| ncine::Font::Font | ( | const char * | fntBufferName, |
| const unsigned char * | fntBufferPtr, | ||
| unsigned long int | fntBufferSize, | ||
| Texture * | texture | ||
| ) |
Constructs the object from an AngelCode's FNT memory buffer and a shared texture object.
|
explicit |
Constructs the object from an AngelCode's FNT file.
| ncine::Font::Font | ( | const char * | fntFilename, |
| const char * | texFilename | ||
| ) |
Constructs the object from an AngelCode's FNT file and a texture file.
| ncine::Font::Font | ( | const char * | fntFilename, |
| Texture * | texture | ||
| ) |
Constructs the object from an AngelCode's FNT file and a shared texture object.