using System; using System.Collections.Generic; using System.Text; namespace Orvid.Graphics.FontSupport { /// /// The base type for a font. /// public abstract class Font { private static Dictionary LoadedFonts = new Dictionary(); public static Font LoadFont(string s) { if (LoadedFonts.ContainsKey(s)) { return LoadedFonts[s]; } return null; } /// /// The name of the font. /// public string Name; /// /// The style of the font. /// public FontStyle Style; /// /// The point-size of the Font rounded to an int. /// public int Size; /// /// The default constructor. /// /// The name of the font. /// The style of the font. /// The point-size of the font. public Font(string name, FontStyle style, int size) { this.Name = name; this.Style = style; this.Size = size; LoadedFonts.Add(name, this); } /// /// The default constructor. /// /// The name of the font. /// The style of the font. /// The point-size of the font. public Font(string name, FontStyle style, double size) { this.Name = name; this.Style = style; this.Size = (int)size; } } }