36 auto face = std::make_unique<FontFace>();
37 if (!face->load(font_path)) {
39 "set_default_font: failed to load '{}'", font_path);
43 auto atlas = std::make_unique<GlyphAtlas>(*face, pixel_size, atlas_size);
45 if (fallback && fallback->is_loaded()) {
46 atlas->add_fallback(*fallback);
54 "Default font set: '{}' {}px atlas {}px", font_path, pixel_size, atlas_size);
bool set_default_font(const std::string &path, uint32_t pixel_size, uint32_t atlas_size=512)
Locate a system font by family and style, then load it as the default.
std::unique_ptr< FontFace > m_default_face
std::unique_ptr< GlyphAtlas > m_default_atlas
std::vector< std::unique_ptr< FontFace > > m_fallback_faces
void shutdown()
Release the FreeType library handle.
bool initialize()
Initialise the FreeType library.
bool add_fallback_font(const std::string &font_path)
Load a font file and register it as a fallback on the default atlas.