/* ----------------------------------------------------------------------------- GSFramework Copyright 2001-2013 Emmanuel Julien. All Rights Reserved. ------------------------------------------------------------------------------*/ #ifndef __FONTCACHE__ #define __FONTCACHE__ #include "font/font_factory.h" #include "font/font_extended.h" #include "memory/nauto_ptr.h" #include "memory/nweak_ptr.h" #include "container/nlist.h" namespace GS { /// Extended font alias. struct FontAlias { String alias; sFontEx font; }; /* @short Font cache. @author Emmanuel Julien (ejulien@nworks.fr) */ class FontCache : public SharedObject { AutoList font_aliases; AutoPtr font_factory; public: FontEx *GetFont(const char *) const; FontAlias *GetAlias(const char *) const; FontEx *GetAliasedFont(const char *) const; FontEx *LoadFont(const char *, const char *alias = 0); void DeleteAlias(const char *); void DeleteAllFont(); FontCache(IFontFactory *factory) : font_factory(factory) {} ~FontCache(); }; typedef SharedPtr sFontCache; } // GS #endif // __FONTCACHE__