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; }
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; }
public static Glyph FromXml(XElement xGlyph) { var res = new Glyph { Code = xGlyph.RequiredUShortAttribute("map"), }; XGlyphShape.FromXml(xGlyph.Element("GlyphShape"), res); return res; }
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; }