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

◆ get_or_rasterize() [2/2]

const GlyphMetrics * MayaFlux::Portal::Text::GlyphAtlas::get_or_rasterize ( FT_ULong  codepoint)

Convenience: look up by Unicode codepoint.

Calls FT_Get_Char_Index internally. Prefer the glyph_index overload when integrating with HarfBuzz output.

Parameters
codepointUnicode codepoint (e.g. U+0041 for 'A').
Returns
Pointer to cached GlyphMetrics, or nullptr on failure.

Definition at line 30 of file GlyphAtlas.cpp.

31{
32 if (!m_face.is_loaded()) {
34 "GlyphAtlas::get_or_rasterize -- FontFace not loaded");
35 return nullptr;
36 }
37
38 const FT_UInt idx = FT_Get_Char_Index(m_face.get_face(), codepoint);
39 if (idx == 0) {
41 "GlyphAtlas: no glyph for codepoint U+{:04X}", static_cast<uint32_t>(codepoint));
42 return nullptr;
43 }
44
45 return get_or_rasterize(idx);
46}
#define MF_ERROR(comp, ctx,...)
#define MF_WARN(comp, ctx,...)
FT_Face get_face() const
Raw FT_Face handle for use by GlyphAtlas.
Definition FontFace.hpp:59
bool is_loaded() const
Returns true after a successful load() call.
Definition FontFace.hpp:53
const GlyphMetrics * get_or_rasterize(FT_UInt glyph_index)
Return metrics for a glyph, rasterizing it into the atlas if needed.
@ API
API calls from external code.
@ Portal
High-level user-facing API layer.

References MayaFlux::Journal::API, MayaFlux::Portal::Text::FontFace::get_face(), get_or_rasterize(), MayaFlux::Portal::Text::FontFace::is_loaded(), m_face, MF_ERROR, MF_WARN, and MayaFlux::Journal::Portal.

+ Here is the call graph for this function: