MyGUI 3.2.0

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files
- Examples

- File List
- Globals

MyGUI_ResourceManualFont.h
Go to the documentation of this file.
1
6 /*
7 This file is part of MyGUI.
8
9 MyGUI is free software: you can redistribute it and/or modify
10 it under the terms of the GNU Lesser General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13
14 MyGUI is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU Lesser General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public License
20 along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
21 */
22 #ifndef __MYGUI_RESOURCE_MANUAL_FONT_H__
23 #define __MYGUI_RESOURCE_MANUAL_FONT_H__
24
25 #include "MyGUI_Prerequest.h"
26 #include "MyGUI_ITexture.h"
27 #include "MyGUI_IFont.h"
28
29 namespace MyGUI
30 {
31
32 class MYGUI_EXPORT ResourceManualFont :
33 public IFont
34 {
35 MYGUI_RTTI_DERIVED( ResourceManualFont )
36
37 public:
38 ResourceManualFont();
39 virtual ~ResourceManualFont();
40
41 virtual void deserialization(xml::ElementPtr _node, Version _version);
42
43 // Returns the glyph info for the specified code point, or the glyph info for a substitute glyph if the code point does not
44 // exist in this font. Returns nullptr if the code point does not exist and there is no substitute glyph available.
45 virtual GlyphInfo* getGlyphInfo(Char _id);
46
47 virtual ITexture* getTextureFont();
48
49 // дефолтная высота, указанная в настройках шрифта
50 virtual int getDefaultHeight();
51
52 private:
53 // Loads the texture specified by mSource.
54 void loadTexture();
55
56 // A map of code points to glyph info objects.
57 typedef std::map<Char, GlyphInfo> CharMap;
58
59 // The following variables are set directly from values specified by the user.
60 std::string mSource; // Source (filename) of the font.
61
62 // The following variables are calculated automatically.
63 int mDefaultHeight; // The nominal height of the font in pixels.
64 GlyphInfo* mSubstituteGlyphInfo; // The glyph info to use as a substitute for code points that don't exist in the font.
65 MyGUI::ITexture* mTexture; // The texture that contains all of the rendered glyphs in the font.
66
67 CharMap mCharMap; // A map of code points to glyph info objects.
68 };
69
70 } // namespace MyGUI
71
72 #endif // __MYGUI_RESOURCE_MANUAL_FONT_H__
MyGUI_Prerequest.h
MyGUI::xml::ElementPtr
Element * ElementPtr
Definition: MyGUI_XmlDocument.h:114
MyGUI_IFont.h
MyGUI::ResourceManualFont
Definition: MyGUI_ResourceManualFont.h:32
MyGUI::IFont
Definition: MyGUI_IFont.h:35
MYGUI_RTTI_DERIVED
#define MYGUI_RTTI_DERIVED(DerivedType)
Definition: MyGUI_RTTI.h:88
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition: MyGUI_Platform.h:120
MyGUI_ITexture.h
MyGUI::ITexture
Definition: MyGUI_ITexture.h:41
MyGUI::Char
unsigned int Char
Definition: MyGUI_Types.h:66
MyGUI::Version
Definition: MyGUI_Version.h:32
MyGUI::GlyphInfo
Definition: MyGUI_FontData.h:53