vdr-plugin-skindesigner/extensions/fontmanager.h

35 lines
1004 B
C
Raw Normal View History

2014-09-27 09:25:14 +02:00
#ifndef __FONTMANAGER_H
#define __FONTMANAGER_H
#include <string>
#include <map>
#include <vector>
#include <vdr/skins.h>
using namespace std;
class cFontManager {
2015-06-18 10:21:43 +02:00
private:
static cMutex mutex;
map < string, map< int, cFont* > > fonts;
cFont *CreateFont(string name, int size);
void InsertFont(string name, int size);
bool FontExists(string name, int size);
cFont *GetFont(string name, int size);
int GetFontHeight(const char *name, int height, int charWidth = 0);
public:
2016-01-26 18:32:38 +01:00
cFontManager(void);
~cFontManager(void);
2015-06-18 10:21:43 +02:00
void Lock(void) { mutex.Lock(); };
void Unlock(void) { mutex.Unlock(); };
void DeleteFonts(void);
int Width(string fontName, int fontSize, const char *text);
int Height(string fontName, int fontSize);
cFont *Font(string fontName, int fontSize);
cFont *FontUncached(string fontName, int fontSize);
void Debug(void);
void ListAvailableFonts(void);
bool FontInstalled(string fontName);
2014-09-27 09:25:14 +02:00
};
#endif //__FONTMANAGER_H