Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

facecache.h

Go to the documentation of this file.
00001 #include "paragui.h"
00002 #include "pgdatacontainer.h"
00003 
00004 #define FT_FLOOR(X)     ((X & -64) / 64)
00005 #define FT_CEIL(X)      (((X + 63) & -64) / 64)
00006 #define PG_FITALIC_ANGLE        0.26f
00007 
00008 #include <ft2build.h>
00009 #include FT_FREETYPE_H
00010 #include FT_ERRORS_H
00011 #include FT_CACHE_H
00012 #include FT_CACHE_IMAGE_H
00013 #include FT_CACHE_SMALL_BITMAPS_H
00014 
00015 #ifdef HASH_MAP_INC
00016 #include HASH_MAP_INC
00017 #endif
00018 #include <map>
00019 
00020 class PG_GlyphCacheItem : public PG_DataContainer {
00021 public:
00022         PG_GlyphCacheItem(Uint32 size) : PG_DataContainer(size) {
00023         };
00024 
00025         int Glyph_Index;
00026         FT_Bitmap Bitmap;
00027 
00028         int Bitmap_left;
00029         int Bitmap_top;
00030         int Advance_x;
00031 };
00032 
00033 typedef std::map<int, PG_GlyphCacheItem*> PG_GlyphCache;
00034 
00035 class PG_FontFaceCacheItem {
00036 public:
00037         
00038         PG_FontFaceCacheItem() {
00039                 Face = NULL;
00040         };
00041 
00042         virtual ~PG_FontFaceCacheItem() {
00043                 for(PG_GlyphCache::iterator i = GlyphCache.begin(); i != GlyphCache.end(); i++) {
00044                         delete (*i).second;
00045                 }
00046                 FT_Done_Face(Face);
00047         };
00048 
00049         FT_Face Face;
00050         PG_GlyphCache GlyphCache;
00051 
00052         //Additional font paramters - usable for style
00053         int Bold_Offset;
00054         int Underline_Height;
00055 
00056         int Ascent;
00057         int Descent;
00058         int Height;
00059         int LineSkip;
00060 
00061         int Use_Kerning;
00062         FT_F26Dot6 fontsize;
00063 };

Generated on Tue Jun 24 01:27:41 2008 for Advanced Strategic Command by  doxygen 1.4.2