Replies: 3 comments
-
You could register the font like in docs: https://learn.microsoft.com/en-us/dotnet/maui/user-interface/fonts?view=net-maui-7.0 Then you'd probably want to use SKTypeface.FromFamilyName(alias); and then only if (font == null || font.FamilyName != alias) you'll manually load from file
The tricky part here would be that realName of the font might be different across platforms.. |
Beta Was this translation helpful? Give feedback.
-
I finally figured out the issue. Below I did similar to what you did above. When I crated the SKPaint object I must set the Typeface at that point and time. If I try to set the type face after creation, it does not work. I am not sure why. var assembly = Assembly.GetExecutingAssembly(); |
Beta Was this translation helpful? Give feedback.
-
Yup it's not working but in MauiProgram.cs
In other solution/project files you can try add your ttf file to Resource/Raw
this is not a solution to the bug, but it is an option to use the font |
Beta Was this translation helpful? Give feedback.
-
I downloaded RobotoRegular.ttf and I am trying to use that font in Skiasharp.
I have googled and googled and googed I am not sure what I am doing wrong.
Beta Was this translation helpful? Give feedback.
All reactions