Esempio n. 1
0
 public static XElement ToXml(Glyph glyph)
 {
     var xGlyph = new XElement("Glyph");
     xGlyph.Add(new XAttribute("map", glyph.Code));
     xGlyph.Add(XGlyphShape.ToXml(glyph));
     return xGlyph;
 }
Esempio n. 2
0
 public static Glyph FromXml(XElement xGlyph, Glyph glyph)
 {
     var xEdges = xGlyph.RequiredElement("edges");
     foreach (var xShapeRecord in xEdges.Elements()) {
         glyph.Records.Add(XShapeRecord.RGBFromXml(xShapeRecord));
     }
     return glyph;
 }
Esempio n. 3
0
 public static Glyph FromXml(XElement xGlyph)
 {
     var res = new Glyph {
         Code = xGlyph.RequiredUShortAttribute("map"),
     };
     XGlyphShape.FromXml(xGlyph.Element("GlyphShape"), res);
     return res;
 }
Esempio n. 4
0
        public static XElement ToXml(Glyph glyph)
        {
            var xShape = new XElement("GlyphShape");
            var xEdges = new XElement("edges");

            foreach (var shapeRecord in glyph.Records) {
                xEdges.Add(XShapeRecord.ToXml(shapeRecord));
            }

            xShape.Add(xEdges);
            return xShape;
        }