Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected override VectorImageSet GenerateIconSet(string fontDataContent)
- {
- VectorImageSet vectorImageSet = new VectorImageSet();
- Glyph currentGlyph = null;
- bool canStartReading = false;
- foreach (string line in fontDataContent.Split(new string[] { "\n" }, StringSplitOptions.RemoveEmptyEntries))
- {
- if (!canStartReading)
- {
- if (line.StartsWith("glyphs:"))
- {
- canStartReading = true;
- }
- continue;
- }
- if (line.Contains("css:"))
- {
- currentGlyph = new Glyph();
- string name = line.Substring(line.IndexOf("css:") + 5).Trim();
- currentGlyph.name = name;
- }
- if (line.Contains("code:") && line.Contains("0x"))
- {
- if (currentGlyph != null)
- {
- string unicode = line.Substring(line.IndexOf("code:") + 6).Trim();
- unicode = unicode.Replace("0x", string.Empty);
- currentGlyph.unicode = unicode;
- vectorImageSet.iconGlyphList.Add(currentGlyph);
- currentGlyph = null;
- }
- }
- }
- return vectorImageSet;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement