00001
00002
00003
00004
00005
00006
00007
00008 #ifndef LIBGUI_CFONT_H_
00009 #define LIBGUI_CFONT_H_
00010
00011 #include "integer.h"
00012
00013 #define FONT_FACE_MONOSPACE 32
00014 #define FONT_FACE_PROPORTIONAL 64
00015 #define FONT_FACE_SYSTEM 0
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #define FONT_STYLE_PLAIN 0
00026 #define FONT_STYLE_BOLD 1
00027 #define FONT_STYLE_ITALIC 2
00028 #define FONT_STYLE_UNDERLINED 4
00029
00037 class CFont
00038 {
00039 private:
00047 CFont(const UINT8* data, INT8 width, INT8 height, CHAR maxCode);
00056 CFont(const UINT8* data, const INT32* offset, const CHAR* index, const INT8* width, INT8 height, CHAR maxCode);
00057 ~CFont();
00062 static CFont m_fonts[];
00063 public:
00068 static CFont* GetDefaultFont();
00080 static CFont* GetFont(INT8 face, INT8 style, INT8 size);
00090 INT8 GetCharWidth(CHAR ch);
00109 INT16 GetCharsWidth(const CHAR* ch, UINT16 offset, UINT16 length);
00120 INT16 GetStringWidth(const CString* str);
00139 INT16 GetSubstringWidth(const CString* str, UINT16 offset, UINT16 length);
00144 INT8 GetHeight();
00149 const UINT8* GetCharData(CHAR ch);
00150 private:
00151 const UINT8* m_data;
00152 const CHAR* m_index;
00153 const INT32* m_offset;
00154 const INT8* m_width;
00155 BOOL m_mono;
00156 INT8 m_monowidth;
00157 INT8 m_height;
00158 CHAR m_maxcode;
00159 };
00160
00161 #endif