public AbstractCombinationCharGenerator() { categorizer = new ElvishCategorizer(); charSize = 24; Xml.Dom.Document symbols = Xml.Dom.Document.OpenResource("symbols.svg"); this.Offset = new Geometry2D.Single.Size(2 * charSize, 3 * charSize); this.PageSize = new Geometry2D.Single.Size(744.09f, 1052.36f); //this.Feed = new Geometry2D.Single.Size(symbols.Root.Attributes.Find(a => a.Name == "width").Value.Parse<float>(), symbols.Root.Attributes.Find(a => a.Name == "height").Value.Parse<float>()); this.Feed = new Geometry2D.Single.Size(charSize, charSize); //foreach (Xml.Dom.Node node in symbols.Root) // if (node is Xml.Dom.Element && (node as Xml.Dom.Element).Name == "path") // this[(node as Xml.Dom.Element).Attributes.Find(a => a.Name == "id").Value[0]] = (node as Xml.Dom.Element).Attributes.Find(a => a.Name == "d").Value; this.ResetPage(); }
public AbstractSvgCombinationCharGenerator(string symbolsFileName, float charSize, bool helpActive = false) { categorizer = new ElvishCategorizer(); this.charSize = charSize; Xml.Dom.Document symbols = Xml.Dom.Document.OpenResource(symbolsFileName); this.Offset = new Geometry2D.Single.Size(2 * charSize, 2 * charSize); this.PageSize = new Geometry2D.Single.Size(744.09f, 1052.36f); //this.Feed = new Geometry2D.Single.Size(symbols.Root.Attributes.Find(a => a.Name == "width").Value.Parse<float>(), symbols.Root.Attributes.Find(a => a.Name == "height").Value.Parse<float>()); this.Feed = new Geometry2D.Single.Size(charSize * 2, charSize * 3); foreach (Xml.Dom.Node node in symbols.Root) { if (node is Xml.Dom.Element && (node as Xml.Dom.Element).Name == "path") { data.Add((node as Xml.Dom.Element).Attributes.Find(a => a.Name == "id").Value, (node as Xml.Dom.Element).Attributes.Find(a => a.Name == "d").Value); } } this.Help = helpActive; this.ResetPage(); }