Crazy Eddies GUI System: CEGUIFontManager.h Source File

Crazy Eddies GUI System 0.7.6

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List

CEGUIFontManager.h

    00001 /***********************************************************************
    00002     filename:   CEGUIFontManager.h
    00003     created:    Sun Jul 19 2009
    00004     author:     Paul D Turner <paul@cegui.org.uk>
    00005 *************************************************************************/
    00006 /***************************************************************************
    00007  *   Copyright (C) 2004 - 2009 Paul D Turner & The CEGUI Development Team
    00008  *
    00009  *   Permission is hereby granted, free of charge, to any person obtaining
    00010  *   a copy of this software and associated documentation files (the
    00011  *   "Software"), to deal in the Software without restriction, including
    00012  *   without limitation the rights to use, copy, modify, merge, publish,
    00013  *   distribute, sublicense, and/or sell copies of the Software, and to
    00014  *   permit persons to whom the Software is furnished to do so, subject to
    00015  *   the following conditions:
    00016  *
    00017  *   The above copyright notice and this permission notice shall be
    00018  *   included in all copies or substantial portions of the Software.
    00019  *
    00020  *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    00021  *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    00022  *   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
    00023  *   IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
    00024  *   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
    00025  *   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
    00026  *   OTHER DEALINGS IN THE SOFTWARE.
    00027  ***************************************************************************/
    00028 #ifndef _CEGUIFontManager_h_
    00029 #define _CEGUIFontManager_h_
    00030
    00031 #include "CEGUISingleton.h"
    00032 #include "CEGUINamedXMLResourceManager.h"
    00033 #include "CEGUIFont.h"
    00034 #include "CEGUIFont_xmlHandler.h"
    00035 #include "CEGUIIteratorBase.h"
    00036
    00037 #if defined(_MSC_VER)
    00038 #   pragma warning(push)
    00039 #   pragma warning(disable : 4275)
    00040 #   pragma warning(disable : 4251)
    00041 #endif
    00042
    00043 // Start of CEGUI namespace section
    00044 namespace CEGUI
    00045 {
    00046 class FreeTypeFont;
    00047 class PixmapFont;
    00048
    00058 class CEGUIEXPORT FontManager :
    00059         public Singleton<FontManager>,
    00060         public NamedXMLResourceManager<Font, Font_xmlHandler>
    00061 {
    00062 public:
    00064     FontManager();
    00065
    00067     ~FontManager();
    00068
    00111     Font& createFreeTypeFont(const String& font_name, const float point_size,
    00112                              const bool anti_aliased,
    00113                              const String& font_filename,
    00114                              const String& resource_group = "",
    00115                              const bool auto_scaled = false,
    00116                              const float native_horz_res = 640.0f,
    00117                              const float native_vert_res = 480.0f,
    00118                              XMLResourceExistsAction action = XREA_RETURN);
    00119
    00160     Font& createPixmapFont(const String& font_name,
    00161                            const String& imageset_filename,
    00162                            const String& resource_group = "",
    00163                            const bool auto_scaled = false,
    00164                            const float native_horz_res = 640.0f,
    00165                            const float native_vert_res = 480.0f,
    00166                            XMLResourceExistsAction action = XREA_RETURN);
    00167
    00175     void notifyDisplaySizeChanged(const Size& size);
    00176
    00188     void writeFontToStream(const String& name, OutStream& out_stream) const;
    00189
    00191     typedef ConstBaseIterator<ObjectRegistry> FontIterator;
    00192
    00198     FontIterator getIterator() const;
    00199
    00200     // ensure we see overloads from template base class
    00201     using NamedXMLResourceManager<Font, Font_xmlHandler>::create;
    00202
    00203 protected:
    00204     // override from base
    00205     void doPostObjectAdditionAction(Font& object);
    00206 };
    00207
    00208 } // End of  CEGUI namespace section
    00209
    00210
    00211 #if defined(_MSC_VER)
    00212 #       pragma warning(pop)
    00213 #endif
    00214
    00215 #endif  // end of guard _CEGUIFontManager_h_