using System;
using Microsoft.Xna.Framework;
using System.Xml.Serialization;

namespace MGTK.Fonts
{
		[Serializable]
        public class FontInfo
        {
                [XmlAttribute ( "face" )]
                public String Face
                {
                        get;
                        set;
                }
 
                [XmlAttribute ( "size" )]
                public Int32 Size
                {
                        get;
                        set;
                }
 
                [XmlAttribute ( "bold" )]
                public Int32 Bold
                {
                        get;
                        set;
                }
 
                [XmlAttribute ( "italic" )]
                public Int32 Italic
                {
                        get;
                        set;
                }
 
                [XmlAttribute ( "charset" )]
                public String CharSet
                {
                        get;
                        set;
                }
 
                [XmlAttribute ( "unicode" )]
                public Int32 Unicode
                {
                        get;
                        set;
                }
 
                [XmlAttribute ( "stretchH" )]
                public Int32 StretchHeight
                {
                        get;
                        set;
                }
 
                [XmlAttribute ( "smooth" )]
                public Int32 Smooth
                {
                        get;
                        set;
                }
 
                [XmlAttribute ( "aa" )]
                public Int32 SuperSampling
                {
                        get;
                        set;
                }
 
                private Rectangle _Padding;
                [XmlAttribute ( "padding" )]
                public String Padding
                {
                        get
                        {
                                return _Padding.X + "," + _Padding.Y + "," + _Padding.Width + "," + _Padding.Height;
                        }
                        set
                        {
                                String[] padding = value.Split ( ',' );
                                _Padding = new Rectangle ( Convert.ToInt32 ( padding[0] ), Convert.ToInt32 ( padding[1] ), Convert.ToInt32 ( padding[2] ), Convert.ToInt32 ( padding[3] ) );
                        }
                }
 
                private Point _Spacing;
                [XmlAttribute ( "spacing" )]
                public String Spacing
                {
                        get
                        {
                                return _Spacing.X + "," + _Spacing.Y;
                        }
                        set
                        {
                                String[] spacing = value.Split ( ',' );
                                _Spacing = new Point ( Convert.ToInt32 ( spacing[0] ), Convert.ToInt32 ( spacing[1] ) );
                        }
                }
 
                [XmlAttribute ( "outline" )]
                public Int32 OutLine
                {
                        get;
                        set;
                }
        }
}

