Owns a single FT_Face loaded from a file path.
Rasterizes and packs glyphs from a FontFace into a TextureContainer.
FontFace * get_default_face() const
Return the default FontFace, or nullptr if set_default_font() has not been called successfully.
GlyphAtlas * get_default_glyph_atlas() const
Return the default GlyphAtlas, or nullptr if set_default_font() has not been called successfully.
TypeFaceFoundry & operator=(TypeFaceFoundry &&)=delete
bool is_initialized() const
Returns true after a successful initialize() call.
std::unique_ptr< FontFace > m_default_face
std::unique_ptr< GlyphAtlas > m_default_atlas
TypeFaceFoundry(const TypeFaceFoundry &)=delete
std::vector< std::unique_ptr< FontFace > > m_fallback_faces
static TypeFaceFoundry & instance()
TypeFaceFoundry & operator=(const TypeFaceFoundry &)=delete
TypeFaceFoundry(TypeFaceFoundry &&)=delete
FT_Library get_library() const
Raw FT_Library handle for use by FontFace.
Singleton owner of the FT_Library handle.
bool add_fallback_font(const std::string &font_path)
Load a font file and register it as a fallback on the default atlas.
bool set_default_font(std::string_view family, std::string_view style, uint32_t pixel_size, uint32_t atlas_size)
Locate a system font by family and style, then load it as the default.