• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • Examples
  • File List
  • Globals

MyGUI_ResourceManualFont.h

Go to the documentation of this file.
00001 
00007 /*
00008     This file is part of MyGUI.
00009     
00010     MyGUI is free software: you can redistribute it and/or modify
00011     it under the terms of the GNU Lesser General Public License as published by
00012     the Free Software Foundation, either version 3 of the License, or
00013     (at your option) any later version.
00014     
00015     MyGUI is distributed in the hope that it will be useful,
00016     but WITHOUT ANY WARRANTY; without even the implied warranty of
00017     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018     GNU Lesser General Public License for more details.
00019     
00020     You should have received a copy of the GNU Lesser General Public License
00021     along with MyGUI.  If not, see <http://www.gnu.org/licenses/>.
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 } // namespace MyGUI
00083 
00084 #endif // __MYGUI_RESOURCE_MANUAL_FONT_H__

Generated on Sun Jan 30 2011 for MyGUI by  doxygen 1.7.1