Embedding custom font in app

VinayahamoorthyVVinayahamoorthyV USMember
edited September 2015 in Xamarin.iOS


I followed the below post and implemented the custom font.
And it is working fine.

I have pushed the code to repository and I am getting error after downloading the code from repo and run the app.

System.ArgumentNullException: Argument cannot be null Parameter name: value.

And i added the error handling code to

NSUrl fontURL = NSBundle.MainBundle.GetUrlForResource("SanFranciscoText-Bold", "otf"); NSError err = CTFontManager.RegisterFontsForUrl(fontURL, CTFontManagerScope.Process); Console.WriteLine(err.Description); lblTitle.Font=NSFont.FromFontName ("SanFranciscoText-Bold", 12.0f) Getting exception in this line;

Error Description shows this message

Error Domain=com.apple.CoreText.CTFontManagerErrorDomain Code=103 "The file is not a recognized or supported font file format." UserInfo=0x600000279f80 {NSLocalizedDescription=The file is not a recognized or supported font file format., CTFontManagerErrorFontURLs=(

), NSLocalizedFailureReason=Font registration was unsuccessful.}

Need help on this

Sign In or Register to comment.