public static string DecodeGlyph(string encodedGlyph, out GlyphFamily family) { string[] values = encodedGlyph.Split(SEPARATOR); if (values.Length == 2 && _nameTable.ContainsValue(values[0])) { string f = values[0]; var pair = _nameTable.First(x => StringComparer.Ordinal.Equals(x.Value, f)); family = pair.Key; return(values[1]); } throw new FormatException("Invalid format for input encoded glyph"); }
private string GetFontIconStyleResourceName(GlyphFamily family) { switch (family) { default: case GlyphFamily.SegoeMDL2: return(string.Empty); case GlyphFamily.FabricMDL2: return("FabricExtFontIcon"); case GlyphFamily.MaterialDesign: return("MaterialDesignFontIcon"); } }
public static string EncodeGlyph(string glyph, GlyphFamily family) { string name = _nameTable[family]; return($"{name}{SEPARATOR}{glyph}"); }