Minetest 5.9.0-dev
 
Loading...
Searching...
No Matches
irr::gui::SGUITTGlyph Struct Reference

Structure representing a single TrueType glyph. More...

#include <CGUITTFont.h>

+ Collaboration diagram for irr::gui::SGUITTGlyph:

Public Member Functions

 SGUITTGlyph ()
 Constructor.
 
 DISABLE_CLASS_COPY (SGUITTGlyph)
 
 SGUITTGlyph (SGUITTGlyph &&other)
 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.
 
CGUITTFontparent
 The pointer pointing to the parent (CGUITTFont)
 

Detailed Description

Structure representing a single TrueType glyph.

Constructor & Destructor Documentation

◆ SGUITTGlyph() [1/2]

irr::gui::SGUITTGlyph::SGUITTGlyph ( )
inline

Constructor.

◆ SGUITTGlyph() [2/2]

irr::gui::SGUITTGlyph::SGUITTGlyph ( SGUITTGlyph &&  other)
inline

This class would be trivially copyable except for the reference count on surface.

◆ ~SGUITTGlyph()

irr::gui::SGUITTGlyph::~SGUITTGlyph ( )
inline

Destructor.

References unload().

+ Here is the call graph for this function:

Member Function Documentation

◆ createGlyphImage()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DISABLE_CLASS_COPY()

irr::gui::SGUITTGlyph::DISABLE_CLASS_COPY ( SGUITTGlyph  )

◆ preload()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unload()

void irr::gui::SGUITTGlyph::unload ( )

Unloads the glyph.

References isLoaded, and surface.

Referenced by ~SGUITTGlyph().

+ Here is the caller graph for this function:

Member Data Documentation

◆ advance

FT_Vector irr::gui::SGUITTGlyph::advance

Glyph advance information.

Referenced by preload().

◆ glyph_page

◆ isLoaded

bool irr::gui::SGUITTGlyph::isLoaded

◆ offset

core::vector2di irr::gui::SGUITTGlyph::offset

The offset of glyph when drawn.

Referenced by irr::gui::CGUITTFont::addTextSceneNode(), and preload().

◆ parent

CGUITTFont* irr::gui::SGUITTGlyph::parent

The pointer pointing to the parent (CGUITTFont)

Referenced by preload().

◆ source_rect

core::recti irr::gui::SGUITTGlyph::source_rect

◆ surface

video::IImage* irr::gui::SGUITTGlyph::surface
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().


The documentation for this struct was generated from the following files: