This repository has been archived by the owner on May 19, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Font Awesome 5 Free
Elvin (Tharindu) Thudugala edited this page Aug 4, 2019
·
6 revisions
- 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.
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());
}
}
- 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());
}
}
- 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>