00001 #ifndef _FREETYPE_CACHE_H_
00002 #define _FREETYPE_CACHE_H_
00003
00004 #include <nds.h>
00005 #include "fontbase.h"
00006
00007 #include "ft2build.h"
00008 #include FT_FREETYPE_H
00009 #include FT_CACHE_H
00010 #include FT_BITMAP_H
00011
00012 namespace WoopsiUI {
00013
00018 class FreeTypeCache {
00019 public:
00020
00025 FreeTypeCache(u32 cacheBytesSize = 32768);
00026
00030 ~FreeTypeCache();
00031
00035 inline void reset() { FTC_Manager_Reset(_manager); };
00036
00044 void loadSbit(FTC_ScalerRec scaler, u32 charMapIndex, u32 codepoint, FTC_SBit* sbit) const;
00045
00046 private:
00047
00048
00049 FT_Library _library;
00050 FTC_Manager _manager;
00051 FTC_CMapCache _charMapCache;
00052 FTC_SBitCache _sbitCache;
00053 FT_Error _error;
00054 };
00055 }
00056
00057 #endif