Crazy Eddie's GUI System  0.8.4
Font_xmlHandler.h
00001 /***********************************************************************
00002     created:    Sun Jul 19 2009
00003     author:     Paul D Turner <paul@cegui.org.uk>
00004 *************************************************************************/
00005 /***************************************************************************
00006  *   Copyright (C) 2004 - 2009 Paul D Turner & The CEGUI Development Team
00007  *
00008  *   Permission is hereby granted, free of charge, to any person obtaining
00009  *   a copy of this software and associated documentation files (the
00010  *   "Software"), to deal in the Software without restriction, including
00011  *   without limitation the rights to use, copy, modify, merge, publish,
00012  *   distribute, sublicense, and/or sell copies of the Software, and to
00013  *   permit persons to whom the Software is furnished to do so, subject to
00014  *   the following conditions:
00015  *
00016  *   The above copyright notice and this permission notice shall be
00017  *   included in all copies or substantial portions of the Software.
00018  *
00019  *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00020  *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00021  *   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00022  *   IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
00023  *   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
00024  *   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
00025  *   OTHER DEALINGS IN THE SOFTWARE.
00026  ***************************************************************************/
00027 #ifndef _CEGUIFont_xmlHandler_h_
00028 #define _CEGUIFont_xmlHandler_h_
00029 
00030 #include "CEGUI/XMLHandler.h"
00031 #include "CEGUI/String.h"
00032 
00033 // Start of CEGUI namespace section
00034 namespace CEGUI
00035 {
00037 class CEGUIEXPORT Font_xmlHandler : public XMLHandler
00038 {
00039 public:
00041     static const String FontSchemaName;
00043     static const String FontElement;
00045     static const String MappingElement;
00047     static const String FontTypeAttribute;
00049     static const String FontNameAttribute;
00051     static const String FontFilenameAttribute;
00053     static const String FontResourceGroupAttribute;
00055     static const String FontAutoScaledAttribute;
00057     static const String FontNativeHorzResAttribute;
00059     static const String FontNativeVertResAttribute;
00061     static const String FontLineSpacingAttribute;
00063     static const String FontSizeAttribute;
00065     static const String FontAntiAliasedAttribute;
00067     static const String MappingCodepointAttribute;
00069     static const String MappingImageAttribute;
00071     static const String MappingHorzAdvanceAttribute;
00073     static const String FontVersionAttribute;
00075     static const String FontTypeFreeType;
00077     static const String FontTypePixmap;
00078 
00080     Font_xmlHandler();
00081 
00083     ~Font_xmlHandler();
00084 
00086     const String& getObjectName() const;
00087 
00089     Font& getObject() const;
00090 
00091     // XMLHandler overrides
00092     const String& getSchemaName() const;
00093     const String& getDefaultResourceGroup() const;
00094 
00095     void elementStart(const String& element, const XMLAttributes& attributes);
00096     void elementEnd(const String& element);
00097 
00098 private:
00100     void elementFontStart(const XMLAttributes& attributes);
00102     void elementFontEnd();
00104     void elementMappingStart(const XMLAttributes& attributes);
00106     void createFreeTypeFont(const XMLAttributes& attributes);
00108     void createPixmapFont(const XMLAttributes& attributes);
00109 
00111     void validateFontFileVersion(const XMLAttributes& attrs);
00112 
00114     Font* d_font;
00116     mutable bool d_objectRead;
00117 };
00118 
00119 } // End of  CEGUI namespace section
00120 
00121 #endif
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends