I am working in native xamarin andorid. I am facing issue to set custom font. I am using "SkiaSharp" plugin to generate canvas view. That plugin is inside PCL so that can be use in both android and ios.
I have one .ttf file in my "Assets" folder.
I generate font path using following code.
string path = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
string FontPath = System.IO.Path.Combine(path, "Myfile.ttf");
this Path I send to PCL to set "SKTypeface"
paint.Typeface = SKTypeface.FromFile(FontPath, 0);
if it is "Typeface" then I can use following approach
Typeface tf = Typeface.CreateFromAsset(Assets, "Myfile.ttf");
I always get null SKTypeface as return value.
I think font path is not found.
bool flag=File.Exist(FontPath)
it always return null value.
How to get path of Asset folder in xamarin andorid? How to set custom font to SKTypeface?