I am trying to use Font Awesome Icons in my Xamarin.iOS project.
In my Xamarin.Android project it was pretty simple:
- I downloaded the Font Awesome WebKit from here
- I copied the .ttf-Files of the fonts I want to use in my Assets folder
- I create a new Typeface for my TextView with the font and use the unicode of the icon
Code:
var myIcon = new TextView(Context);
var regularFont = Typeface.CreateFromAsset(Context.Assets, "fonts/fa-regular-400.ttf");
myIcon.SetTypeface(regularFont, TypefaceStyle.Normal);
myIcon.Text = "\uf007";
I can change TextColor, BackgroundColor, etc. like a normal text.
My problem is, I can't figure out, how to use Font Awesome in my Xamarin.iOS project. Most tutorials and How-Tos are directed to Xamarin.Forms. I tried to merge many of these approaches, but it failed.
The only approach I found is to draw the .svg-Files with SkiaSharp, but that is no option for my use case.
BundleResource
. Check xamarinhelp.com/custom-fonts-xamarin-forms – Lucas Zhang