diff --git a/src/DotNetElements.Extensions.Icons/MaterialIconsFontGenerator.cs b/src/DotNetElements.Extensions.Icons/MaterialIconsFontGenerator.cs index 1c07c7e..8b668af 100644 --- a/src/DotNetElements.Extensions.Icons/MaterialIconsFontGenerator.cs +++ b/src/DotNetElements.Extensions.Icons/MaterialIconsFontGenerator.cs @@ -74,11 +74,10 @@ private async Task WriteToFileAsync(IReadOnlyList iconInfo) iconBuilder.AppendLine($" {varName},"); - iconDictionaryBuilder.AppendLine($" {{ {varName}, \"\\u{icon.Unicode}\" }},"); + iconDictionaryBuilder.AppendLine($" {{ Icons.Material.{varName}, \"&#x{icon.Unicode};\" }},"); } resultBuilder.Append(iconBuilder); - resultBuilder.Append(iconDictionaryHeader); resultBuilder.Append(iconDictionaryBuilder); resultBuilder.Append(fileFooter); @@ -105,25 +104,27 @@ public enum Material private const string iconDictionaryHeader = """ } - - public static class MaterialIconsExtensions + } + + public static partial class MaterialIconsExtensions + { + private readonly static Dictionary unicodeMap = new() { - private readonly static Dictionary unicodeMap = new() - { """; private const string fileFooter = """ - }; - - public static string ToUnicode(this Material materialIcon) - { - return unicodeMap[materialIcon]; - } + }; + + public static string ToUnicode(this Icons.Material materialIcon) + { + return unicodeMap[materialIcon]; } } """; + private record MaterialIconFontInfo(string Name, string UnicodeUrl); + private record MaterialIcon(string Id, string Unicode); }