Reputation: 626
I am developing an android app with Xamarin Studio in C# .NET. I have to use an external font (TTF) file in app. I have copied this ttf file into Assets folder. Now, how to use it in app by axml or code?
It is a Xamarin.Android application.
Please help.
Upvotes: 2
Views: 751
Reputation: 6181
Like so:
var typeface = Typeface.CreateFromAsset (context.Assets, fileName);
Where filename
would be the name of your font, for example Roboto-Light.ttf
and context
is, well, your Context
.
Upvotes: 3