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

Font Awesome 5 Free

Elvin (Tharindu) Thudugala edited this page Aug 4, 2019 · 6 revisions

Plugin.Glypher.FontAwesome5Free

  • Download Fonts from https://fontawesome.com/
  • Install this package into your shared project. There is no need to install it in your platform specific projects.

.NET Standard Projest

  • Reference Plugin.Glypher.FontAwesome5Free NuGet
public partial class App : Application
{
    public App()
    {
        InitializeComponent();
        
        GlyphRegister.Current.Init(typeof(Plugin.Glypher.FontAwesome5Free.GlyphListBrand));
        GlyphRegister.Current.Init(typeof(Plugin.Glypher.FontAwesome5Free.GlyphListRegular));
        GlyphRegister.Current.Init(typeof(Plugin.Glypher.FontAwesome5Free.GlyphListSolid));

        MainPage = new NavigationPage(new MainPage());
    }
}

Android Project

  • Add fonts to Assets folder.
  • Font names must be
    • Font Awesome 5 Brands-Regular-400.otf
    • Font Awesome 5 Free-Regular-400.otf
    • Font Awesome 5 Free-Solid-900.otf
  • You can change font names
public partial class App : Application
{
    public App()
    {
        InitializeComponent();

        var glyphFont = Plugin.Glypher.FontAwesome5Free.GlyphFont.Current;
        switch (Device.RuntimePlatform)
        {
            case Device.Android:
                glyphFont.Brand = "font name.otf#Font Awesome 5 Brands Regular";
                glyphFont.Regular = "font name.otf#Font Awesome 5 Free Regular";
                glyphFont.Solid = "font name.otf#Font Awesome 5 Free Solid";
                break;
        };
        GlyphRegister.Current.Init(typeof(Plugin.Glypher.FontAwesome5Free.GlyphListBrand));
        GlyphRegister.Current.Init(typeof(Plugin.Glypher.FontAwesome5Free.GlyphListRegular));
        GlyphRegister.Current.Init(typeof(Plugin.Glypher.FontAwesome5Free.GlyphListSolid));

        MainPage = new NavigationPage(new MainPage());
    }
}

iOS Project

  • Add fonts to Resources folder
  • Font names must be
    • Font Awesome 5 Brands-Regular-400.otf
    • Font Awesome 5 Free-Regular-400.otf
    • Font Awesome 5 Free-Solid-900.otf
  • Modify Info.plist by add below code.
<key>UIAppFonts</key>
<array>
  <string>Font Awesome 5 Brands-Regular-400.otf</string>
  <string>Font Awesome 5 Free-Regular-400.otf</string>
  <string>Font Awesome 5 Free-Solid-900.otf</string>
</array>
  • You can change font names
<key>UIAppFonts</key>
<array>
  <string>font name.otf</string>
  <string>font name.otf</string>
  <string>font name.otf</string>
</array>

font map