Custom fonts don't load in Xamarin iOS. As described in the Xamarin documentation from 2013 (https://blog.xamarin.com/custom-fonts-in-ios/), I have done the following:
1) Import the font into Resources
2) Set Build Action to "BundleResource" (mistake in the Xamarin documentation)
3) Copy to output directory: "Always Copy"
4) Added the font name to the array "Fonts provided by application" in the Info.plist (making the font available in the storyboard, but not at runtime)
In FinishedLaunching() in the App Delegate, I iterate through all installed fonts:
foreach (var family in UIFont.FamilyNames)
{
System.Diagnostics.Debug.WriteLine($"{family}");
foreach (var names in UIFont.FontNamesForFamilyName(family))
{
System.Diagnostics.Debug.WriteLine($"{names}");
}
}
var fontName = UIFont.FromName("Karbon", 20.0f); // fontName is null
No custom fonts show up, what is the problem here?
Visual Studio Community 2017 for Mac (Preview) Version 7.1 Preview (7.1 build 1178) Runtime: Mono 5.2.0.179 (2017-04/4498dc4) (64-bit)
Xamarin.iOS Version: 10.12.0.5 (Visual Studio Community)
plist
? – Jack