Crazy Eddie's GUI System  0.8.7
FontManager.h
1 /***********************************************************************
2  created: Sun Jul 19 2009
3  author: Paul D Turner <paul@cegui.org.uk>
4 *************************************************************************/
5 /***************************************************************************
6  * Copyright (C) 2004 - 2009 Paul D Turner & The CEGUI Development Team
7  *
8  * Permission is hereby granted, free of charge, to any person obtaining
9  * a copy of this software and associated documentation files (the
10  * "Software"), to deal in the Software without restriction, including
11  * without limitation the rights to use, copy, modify, merge, publish,
12  * distribute, sublicense, and/or sell copies of the Software, and to
13  * permit persons to whom the Software is furnished to do so, subject to
14  * the following conditions:
15  *
16  * The above copyright notice and this permission notice shall be
17  * included in all copies or substantial portions of the Software.
18  *
19  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22  * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25  * OTHER DEALINGS IN THE SOFTWARE.
26  ***************************************************************************/
27 #ifndef _CEGUIFontManager_h_
28 #define _CEGUIFontManager_h_
29 
30 #include "CEGUI/Singleton.h"
31 #include "CEGUI/NamedXMLResourceManager.h"
32 #include "CEGUI/Font.h"
33 #include "CEGUI/Font_xmlHandler.h"
34 #include "CEGUI/IteratorBase.h"
35 
36 #if defined(_MSC_VER)
37 # pragma warning(push)
38 # pragma warning(disable : 4275)
39 # pragma warning(disable : 4251)
40 #endif
41 
42 // Start of CEGUI namespace section
43 namespace CEGUI
44 {
45 class FreeTypeFont;
46 class PixmapFont;
47 
57 class CEGUIEXPORT FontManager :
58  public Singleton<FontManager>,
59  public NamedXMLResourceManager<Font, Font_xmlHandler>,
60  public AllocatedObject<FontManager>
61 {
62 public:
64  FontManager();
65 
67  ~FontManager();
68 
111  Font& createFreeTypeFont(const String& font_name, const float point_size,
112  const bool anti_aliased,
113  const String& font_filename,
114  const String& resource_group = "",
115  const AutoScaledMode auto_scaled = ASM_Disabled,
116  const Sizef& native_res = Sizef(640.0f, 480.0f),
118 
159  Font& createPixmapFont(const String& font_name,
160  const String& imageset_filename,
161  const String& resource_group = "",
162  const AutoScaledMode auto_scaled = ASM_Disabled,
163  const Sizef& native_res = Sizef(640.0f, 480.0f),
165 
173  void notifyDisplaySizeChanged(const Sizef& size);
174 
186  void writeFontToStream(const String& name, OutStream& out_stream) const;
187 
190 
196  FontIterator getIterator() const;
197 
198  // ensure we see overloads from template base class
202 };
203 
204 } // End of CEGUI namespace section
205 
206 
207 #if defined(_MSC_VER)
208 # pragma warning(pop)
209 #endif
210 
211 #endif // end of guard _CEGUIFontManager_h_
No auto scaling takes place.
Definition: Image.h:42
Definition: MemoryAllocatedObject.h:109
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
std::ostream OutStream
Output stream class.
Definition: Base.h:185
AutoScaledMode
Definition: Image.h:39
Definition: Singleton.h:55
Class that encapsulates a typeface.
Definition: Font.h:58
Class providing a shared library of Font objects to the system.
Definition: FontManager.h:57
iterator class for maps
Definition: IteratorBase.h:196
Templatised manager class that loads and manages named XML based resources.
Definition: NamedXMLResourceManager.h:108
XMLResourceExistsAction
Possible actions when loading an XML resource that already exists.
Definition: NamedXMLResourceManager.h:42
Do not load the resource, return the existing instance.
Definition: NamedXMLResourceManager.h:45
ConstMapIterator< ObjectRegistry > FontIterator
ConstBaseIterator type definition.
Definition: FontManager.h:189
String class used within the GUI system.
Definition: String.h:62