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. | |
void | preload (u32 char_index, FT_Face face, video::IVideoDriver *driver, 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 | |
bool | isLoaded |
If true, the glyph has been loaded. | |
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. | |
FT_Vector | advance |
Glyph advance information. | |
video::IImage * | surface |
This is just the temporary image holder. | |
CGUITTFont * | parent |
The pointer pointing to the parent (CGUITTFont) | |
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 irr::gui::checkFontBitmapSize().
Referenced by preload().
irr::gui::SGUITTGlyph::DISABLE_CLASS_COPY | ( | SGUITTGlyph | ) |
void irr::gui::SGUITTGlyph::preload | ( | u32 | char_index, |
FT_Face | face, | ||
video::IVideoDriver * | driver, | ||
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::getLastGlyphPage(), irr::gui::CGUITTFont::getLastGlyphPageIndex(), glyph_page, isLoaded, offset, parent, source_rect, surface, irr::gui::CGUITTGlyphPage::texture, and irr::gui::CGUITTGlyphPage::used_slots.
Referenced by irr::gui::CGUITTFont::getGlyphIndexByChar().
void irr::gui::SGUITTGlyph::unload | ( | ) |
Unloads the glyph.
References isLoaded, and surface.
Referenced by ~SGUITTGlyph().
FT_Vector 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::addTextSceneNode(), irr::gui::CGUITTFont::createTextureFromChar(), irr::gui::CGUITTFont::draw(), irr::gui::CGUITTFont::getGlyphIndexByChar(), and preload().
bool irr::gui::SGUITTGlyph::isLoaded |
If true, the glyph has been loaded.
Referenced by irr::gui::CGUITTFont::getGlyphIndexByChar(), preload(), unload(), and irr::gui::CGUITTGlyphPage::updateTexture().
core::vector2di irr::gui::SGUITTGlyph::offset |
The offset of glyph when drawn.
Referenced by irr::gui::CGUITTFont::addTextSceneNode(), and preload().
CGUITTFont* irr::gui::SGUITTGlyph::parent |
The pointer pointing to the parent (CGUITTFont)
Referenced by preload().
core::recti irr::gui::SGUITTGlyph::source_rect |
The source rectangle for the glyph.
Referenced by irr::gui::CGUITTFont::addTextSceneNode(), irr::gui::CGUITTFont::createTextureFromChar(), irr::gui::CGUITTFont::draw(), preload(), 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().