According to this post: https://devblogs.microsoft.com/xamarin/embedded-fonts-xamarin-forms/
The new way to add a custom font is to add the font as an embeddedResource and then add this line in App.xaml.ca:
[assembly: ExportFont("DSEG7ModernRegular.ttf")]
But I get this error:
Error CS0246 The type or namespace name 'ExportFontAttribute' could not be found (are you missing a using directive or an assembly reference?)
My project references:
- Xamarin.Essentials (1.3.1)
- Xamarin.Forms (4.4.0.991265) - 4.5
- NetStandard.Library (2.0.3)