Convenience: look up by Unicode codepoint.
Tries the primary face first, then each fallback face in registration order, returning the first hit. Prefer the glyph_index overload when integrating with HarfBuzz output (primary face only, no fallback).
- Parameters
-
| codepoint | Unicode codepoint (e.g. U+0041 for 'A'). |
- Returns
- Pointer to cached GlyphMetrics, or nullptr if no face (primary or fallback) has this codepoint.
Definition at line 23 of file GlyphAtlas.cpp.
24{
27 "GlyphAtlas::get_or_rasterize: FontFace not loaded");
28 return nullptr;
29 }
30
31 if (
const FT_UInt idx = FT_Get_Char_Index(
m_face.
get_face(), codepoint); idx != 0) {
33 }
34
36 if (!fallback || !fallback->is_loaded()) {
37 continue;
38 }
39 if (const FT_UInt idx = FT_Get_Char_Index(fallback->get_face(), codepoint); idx != 0) {
41 }
42 }
43
45 "GlyphAtlas: no glyph for codepoint U+{:04X} in primary or {} fallback face(s)",
46 static_cast<uint32_t
>(codepoint),
m_fallbacks.size());
47 return nullptr;
48}
#define MF_ERROR(comp, ctx,...)
#define MF_WARN(comp, ctx,...)
FT_Face get_face() const
Raw FT_Face handle for use by GlyphAtlas.
bool is_loaded() const
Returns true after a successful load() call.
std::vector< FontFace * > m_fallbacks
const GlyphMetrics * get_or_rasterize_from(FontFace &face, FT_UInt glyph_index)
@ 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_from(), MayaFlux::Portal::Text::FontFace::is_loaded(), m_face, m_fallbacks, MF_ERROR, MF_WARN, and MayaFlux::Journal::Portal.