Skip to content
This repository has been archived by the owner on May 19, 2020. It is now read-only.

Commit

Permalink
added Unicode UTF32 support in tools
Browse files Browse the repository at this point in the history
  • Loading branch information
thudugala committed Aug 21, 2019
1 parent 1a950a2 commit e4ff682
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
14 changes: 7 additions & 7 deletions tools/GlyphFieldsGenerator/GlyphFieldsFontAwesome5Pro/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ private static void Main(string[] args)
var originalLabel = iconDuotone.Label;
iconDuotone.Label = $"{originalLabel}-primary";

iconDuotoneSecondaryList.Add(
new Icon
{
IconType = iconDuotone.IconType,
Label = $"{originalLabel}-secondary",
Unicode = $"10{iconDuotone.Unicode}"
});
iconDuotoneSecondaryList.Add(new Icon
{
IconType = iconDuotone.IconType,
Label = $"{originalLabel}-secondary",
UnicodeNumber = int.Parse($"0010{iconDuotone.Unicode}",
System.Globalization.NumberStyles.HexNumber),
});
}

iconList.AddRange(iconDuotoneSecondaryList);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ public abstract class GlyphField

public virtual string Unicode { get; set; }

public int? UnicodeNumber { get; set; }

protected virtual string FontFamily { get; }

protected virtual string Glyph => $"\"\\u{Unicode}\"";
Expand All @@ -33,7 +35,9 @@ protected virtual string GlyphPropertyName

public override string ToString()
{
return $" public static readonly GlyphInfo {GlyphPropertyName} = new GlyphInfo {{ Name = {GlyphName}, Glyph = {Glyph}, FontFamily = {FontFamily} }};";
return UnicodeNumber.HasValue
? $" public static readonly GlyphInfo {GlyphPropertyName} = new GlyphInfo {{ Name = {GlyphName}, UnicodeNumber = {UnicodeNumber}, FontFamily = {FontFamily} }};"
: $" public static readonly GlyphInfo {GlyphPropertyName} = new GlyphInfo {{ Name = {GlyphName}, Glyph = {Glyph}, FontFamily = {FontFamily} }};";
}
}
}

0 comments on commit e4ff682

Please sign in to comment.