Ejemplo n.º 1
0
        public static FontFile Load(Stream stream)
        {
            XmlSerializer deserializer = new XmlSerializer(typeof(FontFile));
            FontFile      file         = (FontFile)deserializer.Deserialize(stream);

            return(file);
        }
Ejemplo n.º 2
0
        public static FontFile Load(String filename)
        {
            XmlSerializer deserializer = new XmlSerializer(typeof(FontFile));
            TextReader    textReader   = new StreamReader(filename);
            FontFile      file         = (FontFile)deserializer.Deserialize(textReader);

            textReader.Close();
            return(file);
        }
Ejemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="fontFile"></param>
        /// <param name="texture"></param>
        public TextRenderer(FontFile fontFile, Texture2D texture)
        {
            this.fontFile = fontFile;
            this.texture  = texture;

            characterMap = new Dictionary <char, FontChar>();

            foreach (var fontCharacter in fontFile.Chars)
            {
                char c = (char)fontCharacter.ID;
                characterMap.Add(c, fontCharacter);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="fontFile"></param>
        /// <param name="texture"></param>
        public TextRenderer(FontFile fontFile, Texture2D texture)
        {
            this.fontFile = fontFile;
            this.texture = texture;

            characterMap = new Dictionary<char, FontChar>();

            foreach(var fontCharacter in fontFile.Chars)
            {
                char c = (char)fontCharacter.ID;
                characterMap.Add(c, fontCharacter);
            }
        }