MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ get_or_rasterize() [1/2]

const GlyphMetrics * MayaFlux::Portal::Text::GlyphAtlas::get_or_rasterize ( FT_UInt  glyph_index)

Return metrics for a glyph, rasterizing it into the atlas if needed.

Parameters
glyph_indexFT_UInt glyph index (from FT_Get_Char_Index).
Returns
Pointer to cached GlyphMetrics, or nullptr if rasterization fails.

Definition at line 16 of file GlyphAtlas.cpp.

17{
18 auto it = m_cache.find(glyph_index);
19 if (it != m_cache.end()) {
20 return &it->second;
21 }
22
23 if (!rasterize(glyph_index)) {
24 return nullptr;
25 }
26
27 return &m_cache.at(glyph_index);
28}
bool rasterize(FT_UInt glyph_index)
std::unordered_map< FT_UInt, GlyphMetrics > m_cache

References m_cache, and rasterize().

Referenced by get_or_rasterize(), and MayaFlux::Portal::Text::lay_out().

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