Awesome
XF.TextIcon
Xamarin Forms Library for Icon font Works in Android and iOS Required Xamarin.Forms 3.5.0.274416 or above
Supporting Font
- Ionicon https://ionicons.com/
- FontAwesome 5 Free https://fontawesome.com/icons
- Icon8 Windows 10 https://github.com/icons8/windows-10-icons
- Google Material Icon https://material.io/tools/icons/?style=baseline
- IcoFont https://icofont.com/
Support UI Control
- Span
- Label
Setup
- Forms Project
- Install Nuget Package
Install-Package XF.TextIcon.Forms -Version 1.0.0.0
- Android Project
- Add Fonts to Asset Folder and make sure Build Action is AndroidAsset
- iOS Project
- Add Fonts to Resources folder and make sure Build Action is BundleResource
- Insert below to info.plist
<key>UIAppFonts</key>
<array>
<string>ionicons.ttf</string>
<string>icons8-win10.ttf</string>
<string>icofont.ttf</string>
<string>GoogleMaterial.ttf</string>
<string>FontAwesome5FreeRegular.otf</string>
<string>FontAwesome5FreeSolid.otf</string>
<string>FontAwesome5FreeBrand.otf</string>
</array>
How to use
To use in xaml, you may set the icon as below. The IconName can be check from CheatSheet.
<Label>
<Label.FormattedText>
<FormattedString>
<texticon:IconSpan IconType="IonicIcon" IconName="ion-ios-arrow-round-forward" FontSize="Large"/>
<texticon:IconSpan IconType="Icon8Win10" IconName="icons8-win10-clipboard" FontSize="Large"/>
<texticon:IconSpan IconType="IcoFont" IconName="icofont-gift-box" FontSize="Large"/>
<texticon:IconSpan IconType="GoogleMaterial" IconName="material-add_shopping_cart" FontSize="Large"/>
<texticon:IconSpan IconType="FontAwesomeBrand" IconName="fontawesome5-free-brand-facebook" FontSize="Large"/>
<texticon:IconSpan IconType="FontAwesomeRegular" IconName="fontawesome5-free-regular-calendar-check" FontSize="Large"/>
<texticon:IconSpan IconType="FontAwesomeSolid" IconName="fontawesome5-free-solid-angry" FontSize="Large"/>
</FormattedString>
</Label.FormattedText>
</Label>
<texticon:IconLabel IconType="FontAwesomeSolid" IconName="fontawesome5-free-solid-angry" FontSize="Large"/>
Further improvement
Please let me know if any request on different fonts, providing the otf / ttf file will be nice.