Example #1
0
        private static FontTexture Parse(XElement xElement)
        {
            FontTexture result = new FontTexture();

            result.FontHeight   = int.Parse(xElement.Attribute(strFontHeight).Value);
            result.FirstChar    = (char)int.Parse(xElement.Attribute(strFirstChar).Value);
            result.LastChar     = (char)int.Parse(xElement.Attribute(strLastChar).Value);
            result.CharInfoDict = CharacterInfoDictHelper.Parse(
                xElement.Element(CharacterInfoDictHelper.strCharacterInfoDict));

            return(result);
        }
Example #2
0
        private FontResource()
        {
            this.FontBitmap = ManifestResourceLoader.LoadBitmap("LucidaTypewriterRegular.ttf.png");

            string   xmlContent = ManifestResourceLoader.LoadTextFile("LucidaTypewriterRegular.ttf.xml");
            XElement xElement   = XElement.Parse(xmlContent, LoadOptions.None);

            this.FontHeight   = int.Parse(xElement.Attribute(strFontHeight).Value);
            this.FirstChar    = (char)int.Parse(xElement.Attribute(strFirstChar).Value);
            this.LastChar     = (char)int.Parse(xElement.Attribute(strLastChar).Value);
            this.CharInfoDict = CharacterInfoDictHelper.Parse(
                xElement.Element(CharacterInfoDictHelper.strCharacterInfoDict));
        }