I made this helper class in C# (Xamarin) to programmatically set the text property. It which works pretty well for me:
internal static class FontAwesomeManager { private static readonly Typeface AwesomeFont = Typeface.CreateFromAsset(App.Application.Context.Assets, "FontAwesome.ttf"); private static readonly Dictionary<FontAwesomeIcon, string> IconMap = new Dictionary<FontAwesomeIcon, string> { {FontAwesomeIcon.Bars, "\uf0c9"}, {FontAwesomeIcon.Calendar, "\uf073"}, {FontAwesomeIcon.Child, "\uf1ae"}, {FontAwesomeIcon.Cog, "\uf013"}, {FontAwesomeIcon.Eye, "\uf06e"}, {FontAwesomeIcon.Filter, "\uf0b0"}, {FontAwesomeIcon.Link, "\uf0c1"}, {FontAwesomeIcon.ListOrderedList, "\uf0cb"}, {FontAwesomeIcon.PencilSquareOutline, "\uf044"}, {FontAwesomeIcon.Picture, "\uf03e"}, {FontAwesomeIcon.PlayCircleOutline, "\uf01d"}, {FontAwesomeIcon.SignOut, "\uf08b"}, {FontAwesomeIcon.Sliders, "\uf1de"} }; public static void Awesomify(this TextView view, FontAwesomeIcon icon) { var iconString = IconMap[icon]; view.Text = iconString; view.SetTypeface(AwesomeFont, TypefaceStyle.Normal); } } enum FontAwesomeIcon { Bars, Calendar, Child, Cog, Eye, Filter, Link, ListOrderedList, PencilSquareOutline, Picture, PlayCircleOutline, SignOut, Sliders }
Should be easy enough to convert to Java, I think. Hope it helps someone!