first commit

This commit is contained in:
2026-06-22 11:49:35 +02:00
commit d805f2ba86
619 changed files with 126873 additions and 0 deletions

View File

@ -0,0 +1,56 @@
/* -----------------------------------------------------------------------------
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 <FontAlias *> font_aliases;
AutoPtr <IFontFactory> 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 <FontCache> sFontCache;
} // GS
#endif // __FONTCACHE__