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
43namespace CEGUI
44{
45class FreeTypeFont;
46class PixmapFont;
47
57class CEGUIEXPORT FontManager :
58 public Singleton<FontManager>,
59 public NamedXMLResourceManager<Font, Font_xmlHandler>,
60 public AllocatedObject<FontManager>
61{
62public:
65
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
174
186 void writeFontToStream(const String& name, OutStream& out_stream) const;
187
190
197
198 // ensure we see overloads from template base class
199 using NamedXMLResourceManager<Font, Font_xmlHandler>::createFromContainer;
200 using NamedXMLResourceManager<Font, Font_xmlHandler>::createFromFile;
201 using NamedXMLResourceManager<Font, Font_xmlHandler>::createFromString;
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_
Definition: MemoryAllocatedObject.h:110
iterator class for maps
Definition: IteratorBase.h:197
Class providing a shared library of Font objects to the system.
Definition: FontManager.h:61
Font & createFreeTypeFont(const String &font_name, const float point_size, const bool anti_aliased, const String &font_filename, const String &resource_group="", const AutoScaledMode auto_scaled=ASM_Disabled, const Sizef &native_res=Sizef(640.0f, 480.0f), XMLResourceExistsAction action=XREA_RETURN)
Creates a FreeType type font.
Font & createPixmapFont(const String &font_name, const String &imageset_filename, const String &resource_group="", const AutoScaledMode auto_scaled=ASM_Disabled, const Sizef &native_res=Sizef(640.0f, 480.0f), XMLResourceExistsAction action=XREA_RETURN)
Creates a Pixmap type font.
void notifyDisplaySizeChanged(const Sizef &size)
Notify the FontManager that display size may have changed.
FontManager()
Constructor.
void writeFontToStream(const String &name, OutStream &out_stream) const
Writes a full XML font file for the specified Font to the given OutStream.
FontIterator getIterator() const
Return a FontManager::FontIterator object to iterate over the available Font objects.
~FontManager()
Destructor.
ConstMapIterator< ObjectRegistry > FontIterator
ConstBaseIterator type definition.
Definition: FontManager.h:189
Handler class used to parse the Font XML files to create Font objects.
Definition: Font_xmlHandler.h:38
Class that encapsulates a typeface.
Definition: Font.h:62
Templatised manager class that loads and manages named XML based resources.
Definition: NamedXMLResourceManager.h:109
Definition: Singleton.h:56
String class used within the GUI system.
Definition: String.h:64
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
AutoScaledMode
Definition: Image.h:40
@ ASM_Disabled
No auto scaling takes place.
Definition: Image.h:42
XMLResourceExistsAction
Possible actions when loading an XML resource that already exists.
Definition: NamedXMLResourceManager.h:43
@ XREA_RETURN
Do not load the resource, return the existing instance.
Definition: NamedXMLResourceManager.h:45
std::ostream OutStream
Output stream class.
Definition: Base.h:185