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

Commit

Permalink
added span support and Unicode UTF32 support
Browse files Browse the repository at this point in the history
  • Loading branch information
thudugala committed Aug 21, 2019
1 parent 0e9c60f commit 1a950a2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
5 changes: 5 additions & 0 deletions Source/Plugin.Glypher/FontGlyph.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ private static void SetControl(BindableObject bindable, GlyphInfo newGlyphInfo)
label.Text = newGlyphInfo?.Glyph;
break;

case Span span:
span.FontFamily = newGlyphInfo?.FontFamily;
span.Text = newGlyphInfo?.Glyph;
break;

case Button button:
button.FontFamily = newGlyphInfo?.FontFamily;
button.Text = newGlyphInfo?.Glyph;
Expand Down
17 changes: 14 additions & 3 deletions Source/Plugin.Glypher/GlyphInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,36 @@
namespace Plugin.Glypher
{
/// <summary>
/// Font Image representation.
/// Font Image representation.
/// </summary>
[DebuggerDisplay("Name={Name}")]
[TypeConverter(typeof(GlyphInfoTypeConverter))]
public class GlyphInfo
{
private string _glyph;

/// <summary>
/// Font Family.
/// </summary>
public string FontFamily { get; set; }

/// <summary>
/// Glyph
/// </summary>
public string Glyph { get; set; }
public string Glyph
{
get => UnicodeNumber.HasValue ? char.ConvertFromUtf32(UnicodeNumber.Value) : _glyph;
set => _glyph = value;
}

/// <summary>
/// Glyph Name
/// </summary>
public string Name { get; set; }

/// <summary>
/// Unicode Number
/// </summary>
public int? UnicodeNumber { get; set; }
}
}
2 changes: 1 addition & 1 deletion Source/Plugin.Glypher/Plugin.Glypher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<Description>This plugin extend support for font-glyphs (font-icons) in Xamarin.Forms applications.</Description>
<PackageIconUrl>https://raw.githubusercontent.com/thudugala/Plugin.Glypher/master/screenshots/icon.png</PackageIconUrl>
<Copyright>Copyright © Elvin (Tharindu) Thudugala</Copyright>
<Version>1.0.0</Version>
<Version>1.1.0</Version>
<PackageReleaseNotes>Check: https://github.com/thudugala/Plugin.Glypher/releases </PackageReleaseNotes>
<owners>ththlk</owners>

Expand Down

0 comments on commit 1a950a2

Please sign in to comment.