00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __MYGUI_RESOURCE_MANUAL_FONT_H__
00024 #define __MYGUI_RESOURCE_MANUAL_FONT_H__
00025
00026 #include "MyGUI_Prerequest.h"
00027 #include "MyGUI_Common.h"
00028 #include "MyGUI_ITexture.h"
00029 #include "MyGUI_IFont.h"
00030
00031 namespace MyGUI
00032 {
00033
00034 class MYGUI_EXPORT ResourceManualFont :
00035 public IFont
00036 {
00037 MYGUI_RTTI_DERIVED( ResourceManualFont );
00038
00039 private:
00040 typedef std::vector<RangeInfo> VectorRangeInfo;
00041 typedef std::vector<PairCodeCoord> VectorPairCodeCoord;
00042
00043 public:
00044 ResourceManualFont();
00045 virtual ~ResourceManualFont();
00046
00047 virtual void deserialization(xml::ElementPtr _node, Version _version);
00048
00049 virtual GlyphInfo* getGlyphInfo(Char _id);
00050
00051 virtual ITexture* getTextureFont() { return mTexture; }
00052
00053
00054 virtual int getDefaultHeight() { return mDefaultHeight; }
00055
00056 private:
00057 void addGlyph(Char _index, const IntCoord& _coord);
00058
00059 void initialise();
00060
00061 void addGlyph(GlyphInfo * _info, Char _index, int _left, int _top, int _right, int _bottom, int _finalw, int _finalh, float _aspect, int _addHeight = 0);
00062
00063 void addRange(VectorPairCodeCoord& _info, size_t _first, size_t _last, int _width, int _height, float _aspect);
00064 void checkTexture();
00065
00066 private:
00067 std::string mSource;
00068 int mDefaultHeight;
00069
00070
00071 GlyphInfo mSpaceGlyphInfo;
00072
00073
00074 VectorPairCodeCoord mVectorPairCodeCoord;
00075
00076
00077 VectorRangeInfo mVectorRangeInfo;
00078
00079 MyGUI::ITexture* mTexture;
00080 };
00081
00082 }
00083
00084 #endif // __MYGUI_RESOURCE_MANUAL_FONT_H__