Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
irr::gui::SGUITTGlyph Struct Reference

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.
 

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)
inlinenoexcept

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 errorstream, FATAL_ERROR, x, and y.

Referenced by preload().

+ Here is the caller graph for this function:

◆ DISABLE_CLASS_COPY()

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

◆ isLoaded()

bool irr::gui::SGUITTGlyph::isLoaded ( ) const
inline

If true, the glyph has been loaded.

References source_rect.

Referenced by irr::gui::CGUITTFont::getGlyphIndexByChar().

+ Here is the caller graph for this function:

◆ preload()

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

+ 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 source_rect, and surface.

Referenced by ~SGUITTGlyph().

+ Here is the caller graph for this function:

Member Data Documentation

◆ advance

core::vector2di irr::gui::SGUITTGlyph::advance

Glyph advance information.

Referenced by preload().

◆ glyph_page

u32 irr::gui::SGUITTGlyph::glyph_page

◆ offset

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

The offset of glyph when drawn.

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: