Hello,
but how to use
OpenSansRegular
here or otherttf
fonts?
Please follow the steps below:
- Drag and copy the ttf file into the Resources folder in your .NET iOS project, make sure the Build Action is
BundleResource
. - Add the following key in Info.plist
<key>UIAppFonts</key> <arra <string>OpenSans-Regular.ttf</string> </array>
- Consume the font like the following
context.SelectFont('OpenSans-Regular',15,CGTextEncoding.MacRoman)
For more details, you could refer to Using custom Fonts in Xamarin.iOS - Xamarin Blog
(This doc is old and is about Xamarin.iOS, however, it applies to MAUI. I understand you are using .net-ios, you could have a look.)
but CGContext.ShowTextAtPoint to show
unicode
will be not displayed right which means it can not showunicode
right?
Yes, you are right. I tested with the unicode character \uf30c
, it can not be shown with the ionicons.ttf.
Best Regards,
Wenyan Zhang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.