Fix issue #116 - when fonts deleted and reloaded signal back immediately to all registered controls to refresh their font

This commit is contained in:
SoftCoder
2017-01-30 11:20:01 -08:00
parent b2aa5e1991
commit 6f350d6319
20 changed files with 304 additions and 82 deletions

View File

@@ -22,7 +22,7 @@ using std::string;
//class Text;
namespace Shared { namespace Graphics {
// =====================================================
// class FontMetrics
// =====================================================
@@ -90,6 +90,7 @@ protected:
FontMetrics metrics;
Text *textHandler;
string fontUniqueId;
public:
//constructor & destructor
@@ -97,6 +98,9 @@ public:
virtual ~Font();
virtual void init()=0;
virtual void end()=0;
void setFontUniqueId(string id) { fontUniqueId = id; }
string getFontUniqueId() { return fontUniqueId; }
//get
int getWidth() const;
@@ -147,6 +151,12 @@ Font3D *ConvertFont2DTo3D(Font2D *font);
const char* findFont(const char *firstFontToTry=NULL,const char *firstFontFamilyToTry=NULL);
class FontChangedCallbackInterface {
public:
virtual void FontChangedCallback(std::string fontUniqueId, Font *font) = 0;
virtual ~FontChangedCallbackInterface() {};
};
}}//end namespace
#endif