Structure representing a single TrueType glyph. More...
#include <CGUITTFont.h>
Public Member Functions | |
SGUITTGlyph () | |
Constructor. | |
DISABLE_CLASS_COPY (SGUITTGlyph) | |
SGUITTGlyph (SGUITTGlyph &&other) noexcept | |
This class would be trivially copyable except for the reference count on surface . | |
~SGUITTGlyph () | |
Destructor. | |
bool | isLoaded () const |
If true, the glyph has been loaded. | |
void | preload (u32 char_index, FT_Face face, CGUITTFont *parent, u32 font_size, const FT_Int32 loadFlags) |
Preload the glyph. | |
void | unload () |
Unloads the glyph. | |
video::IImage * | createGlyphImage (const FT_Bitmap &bits, video::IVideoDriver *driver) const |
Creates the IImage object from the FT_Bitmap. | |
Public Attributes | |
u32 | glyph_page |
The page the glyph is on. | |
core::recti | source_rect |
The source rectangle for the glyph. | |
core::vector2di | offset |
The offset of glyph when drawn. | |
core::vector2di | advance |
Glyph advance information. | |
video::IImage * | surface |
This is just the temporary image holder. | |
Structure representing a single TrueType glyph.
|
inline |
Constructor.
|
inlinenoexcept |
This class would be trivially copyable except for the reference count on surface
.
|
inline |
video::IImage * irr::gui::SGUITTGlyph::createGlyphImage | ( | const FT_Bitmap & | bits, |
video::IVideoDriver * | driver ) const |
Creates the IImage object from the FT_Bitmap.
References errorstream, FATAL_ERROR, x, and y.
Referenced by preload().
irr::gui::SGUITTGlyph::DISABLE_CLASS_COPY | ( | SGUITTGlyph | ) |
|
inline |
If true, the glyph has been loaded.
References source_rect.
Referenced by irr::gui::CGUITTFont::getGlyphIndexByChar().
void irr::gui::SGUITTGlyph::preload | ( | u32 | char_index, |
FT_Face | face, | ||
CGUITTFont * | parent, | ||
u32 | font_size, | ||
const FT_Int32 | loadFlags ) |
Preload the glyph.
The preload process occurs when the program tries to cache the glyph from FT_Library. However, it simply defines the SGUITTGlyph's properties and will only create the page textures if necessary. The actual creation of the textures should only occur right before the batch draw call.
References advance, irr::gui::CGUITTGlyphPage::available_slots, createGlyphImage(), irr::gui::CGUITTFont::createGlyphPage(), irr::gui::CGUITTGlyphPage::dirty, irr::gui::CGUITTFont::getDriver(), irr::gui::CGUITTFont::getLastGlyphPage(), irr::gui::CGUITTFont::getLastGlyphPageIndex(), glyph_page, offset, source_rect, surface, irr::gui::CGUITTGlyphPage::texture, irr::gui::CGUITTGlyphPage::used_slots, and warningstream.
Referenced by irr::gui::CGUITTFont::getGlyphIndexByChar().
void irr::gui::SGUITTGlyph::unload | ( | ) |
Unloads the glyph.
References source_rect, and surface.
Referenced by ~SGUITTGlyph().
core::vector2di irr::gui::SGUITTGlyph::advance |
Glyph advance information.
Referenced by preload().
u32 irr::gui::SGUITTGlyph::glyph_page |
The page the glyph is on.
Referenced by irr::gui::CGUITTFont::createTextureFromChar(), irr::gui::CGUITTFont::draw(), irr::gui::CGUITTFont::getGlyphIndexByChar(), and preload().
core::vector2di irr::gui::SGUITTGlyph::offset |
The offset of glyph when drawn.
Referenced by preload().
core::recti irr::gui::SGUITTGlyph::source_rect |
The source rectangle for the glyph.
Referenced by irr::gui::CGUITTFont::createTextureFromChar(), irr::gui::CGUITTFont::draw(), isLoaded(), preload(), unload(), and irr::gui::CGUITTGlyphPage::updateTexture().
|
mutable |
This is just the temporary image holder.
After this glyph is paged, it will be dropped.
Referenced by preload(), unload(), and irr::gui::CGUITTGlyphPage::updateTexture().