You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
608 B
29 lines
608 B
#ifndef FONTMANAGER_H
|
|
#define FONTMANAGER_H
|
|
|
|
#include "font.h"
|
|
|
|
class FontManager
|
|
{
|
|
public:
|
|
/// Release fonts references, thus making possible to destruct them
|
|
void releaseFonts();
|
|
|
|
/// Import a font from .otfont file
|
|
bool importFont(std::string fontFile);
|
|
|
|
bool fontExists(const std::string& fontName);
|
|
FontPtr getFont(const std::string& fontName);
|
|
FontPtr getDefaultFont();
|
|
|
|
void setDefaultFont(const std::string& fontName) { m_defaultFont = getFont(fontName); }
|
|
|
|
private:
|
|
std::vector<FontPtr> m_fonts;
|
|
FontPtr m_defaultFont;
|
|
};
|
|
|
|
extern FontManager g_fonts;
|
|
|
|
#endif
|