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