2011-08-14 04:09:11 +02:00
|
|
|
#ifndef FONTMANAGER_H
|
|
|
|
#define FONTMANAGER_H
|
|
|
|
|
|
|
|
#include "font.h"
|
|
|
|
|
|
|
|
class FontManager
|
|
|
|
{
|
|
|
|
public:
|
2011-08-15 16:06:15 +02:00
|
|
|
/// Release fonts references, thus making possible to destruct them
|
2011-08-14 04:09:11 +02:00
|
|
|
void releaseFonts();
|
|
|
|
|
2011-08-15 16:06:15 +02:00
|
|
|
/// Import a font from .otfont file
|
2011-08-14 04:09:11 +02:00
|
|
|
bool importFont(std::string fontFile);
|
|
|
|
|
|
|
|
bool fontExists(const std::string& fontName);
|
|
|
|
FontPtr getFont(const std::string& fontName);
|
2011-08-26 17:06:52 +02:00
|
|
|
FontPtr getDefaultFont() { return m_defaultFont; }
|
2011-08-14 04:09:11 +02:00
|
|
|
|
|
|
|
void setDefaultFont(const std::string& fontName) { m_defaultFont = getFont(fontName); }
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::vector<FontPtr> m_fonts;
|
|
|
|
FontPtr m_defaultFont;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern FontManager g_fonts;
|
|
|
|
|
|
|
|
#endif
|