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 32 of file GlyphAtlas.cpp.

33{
34 if (!m_face.is_loaded()) {
36 "GlyphAtlas::get_or_rasterize -- FontFace not loaded");
37 return nullptr;
38 }
39
40 const FT_UInt idx = FT_Get_Char_Index(m_face.get_face(), codepoint);
41 if (idx == 0) {
43 "GlyphAtlas: no glyph for codepoint U+{:04X}", static_cast<uint32_t>(codepoint));
44 return nullptr;
45 }
46
47 return get_or_rasterize(idx);
48}
#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:57
bool is_loaded() const
Returns true after a successful load() call.
Definition FontFace.hpp:51
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: