/************************************************************************* Destroys all Font objects registered in the system *************************************************************************/ void FontManager::destroyAllFonts(void) { while (!d_fonts.empty()) { destroyFont(d_fonts.begin()->first); } }
/************************************************************************* Destroys the given Font object *************************************************************************/ void FontManager::destroyFont(FontBase* font) { if (font != NULL) { destroyFont(font->getName()); } }
static void msdfgen_hello_world() { msdfgen::FreetypeHandle* ft = msdfgen::initializeFreetype(); if ( ft ) { msdfgen::FontHandle* font = loadFont( ft, "OpenSans.ttf" ); if ( font ) { msdfgen::Shape shape; if ( loadGlyph( shape, font, 'A' )) { shape.normalize(); // max. angle edgeColoringSimple( shape, 3.0 ); // image width, height msdfgen::Bitmap<msdfgen::FloatRGB> msdf( 32, 32 ); // range, scale, translation generateMSDF( msdf, shape, 4.0, 1.0, msdfgen::Vector2( 4.0, 4.0 )); } destroyFont( font ); } deinitializeFreetype( ft ); } }