FontFamily setting crashes iOS

5 posts, 0 answers
  1. Shalin
    Shalin avatar
    61 posts
    Member since:
    May 2015

    Posted 06 Feb Link to this post

    hi

    if we set font family in autocompleteview, iOS application crashes.

    in page,

    FontFamily="{StaticResource RegularFont}"

    in App.xaml,

    <OnPlatform x:TypeArguments="x:String" x:Key="RegularFont">
                    <On Platform="Android" Value="Heebo-Light.ttf#Heebo Light"/>
                    <On Platform="iOS" Value="HelveticaNeue"/>
                    <On Platform="UWP" Value="Assets/Fonts/HelveticaNeue.ttf#HelveticaNeue"/>
                </OnPlatform>

    Crash details,

    Message,

    Value cannot be null.
    Parameter name: descriptor

    Stacktrace,

    at UIKit.UIFont._FromDescriptor (UIKit.UIFontDescriptor descriptor, System.nfloat pointSize) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.2.1.13/src/Xamarin.iOS/UIKit/UIFont.g.cs:106
    at UIKit.UIFont.FromDescriptor (UIKit.UIFontDescriptor descriptor, System.nfloat pointSize) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.2.1.13/src/Xamarin.iOS/UIKit/UIFont.cs:179
    at Telerik.XamarinForms.InputRenderer.iOS.EntryAdapter.UpdateFont (Telerik.XamarinForms.Input.RadEntry sourceOwner, Telerik.XamarinForms.InputRenderer.iOS.BorderUITextField targetOwner) [0x0007a] in <e72706fd0dd5405fabc91cd72e3c9f5d>:0
    at Telerik.XamarinForms.InputRenderer.iOS.EntryAdapter.UpdateCore (Telerik.XamarinForms.Input.RadEntry sourceOwner, Telerik.XamarinForms.InputRenderer.iOS.BorderUITextField targetOwner, System.String propertyName) [0x0014d] in <e72706fd0dd5405fabc91cd72e3c9f5d>:0
    at Telerik.XamarinForms.Common.FacadeAdapterBase`2[S,T].Update (System.Object sourceOwner, System.Object targetOwner, System.String propertyName, System.Object sourceOwnerRoot, System.Object targetOwnerRoot) [0x00000] in <b1d124df8dbf4987b1a7f6b0a5485748>:0
    at Telerik.XamarinForms.Common.XamarinToNativeControlExtensions.Update[T,K] (T nativeElement, K xfЕlement, System.String propertyName, System.Object sourceOwnerRoot, System.Object targetOwnerRoot) [0x00031] in <b1d124df8dbf4987b1a7f6b0a5485748>:0
    at Telerik.XamarinForms.InputRenderer.iOS.EntryRenderer.OnElementPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x0002a] in <e72706fd0dd5405fabc91cd72e3c9f5d>:0
    at (wrapper delegate-invoke) <Module>.invoke_void_object_PropertyChangedEventArgs(object,System.ComponentModel.PropertyChangedEventArgs)
    at Xamarin.Forms.BindableObject.OnPropertyChanged (System.String propertyName) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:150
    at Xamarin.Forms.Element.OnPropertyChanged (System.String propertyName) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:370
    at Telerik.XamarinForms.Input.RadEntry.OnPropertyChanged (System.String propertyName) [0x0002a] in <e72706fd0dd5405fabc91cd72e3c9f5d>:0
    at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x00114] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:623
    at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x0015b] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:417
    at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean fromTarget) [0x00225] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:173
    at Xamarin.Forms.BindingExpression.Apply (System.Boolean fromTarget) [0x0003e] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:57
    at Xamarin.Forms.BindingExpression+BindingExpressionPart.<PropertyChanged>b__49_0 () [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:615
    at Foundation.NSAsyncActionDispatcher.Apply () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.2.1.13/src/Xamarin.iOS/Foundation/NSAction.cs:152
    at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
    at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.2.1.13/src/Xamarin.iOS/UIKit/UIApplication.cs:79
    at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0002c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.2.1.13/src/Xamarin.iOS/UIKit/UIApplication.cs:63
    at listLayout.iOS.Application.Main (System.String[] args) [0x00001] in /Users/xamarindev/Documents/sample/listLayout/listLayout/listLayout.iOS/Main.cs:17

     

  2. Didi
    Admin
    Didi avatar
    243 posts

    Posted 08 Feb Link to this post

    Hello Shalin,

    Thank you for the provided stack-trace.

    This exception occurs on iOS when the file names of the fonts used in the project are not added to the info.plist file inside the iOS project. For more information how to add custom fonts in Xamarin.Forms please check the following article: Custom Fonts in Xamarin.Forms

    I hope I was helpful. 

    Regards,
    Didi
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Shalin
    Shalin avatar
    61 posts
    Member since:
    May 2015

    Posted 08 Feb in reply to Didi Link to this post

    as i know "HelveticaNeue" is already in iOS, even though same font works fine in every other places through app.
  4. Didi
    Admin
    Didi avatar
    243 posts

    Posted 08 Feb Link to this post

    Hi Shalin,

    I have tested similar scenario and I reproduced the same exception when the fonts are not added to the info.plist file. 

    Could you please verify that the exception occurs when the fonts were added to the info.plist file. And if so could you please send me a sample project where the issue could be reproduced? In this case I could research it further. Note that you should open a support ticket and attach the project there because in the forum only image attachments are allowed.

    Thank you in advance.

    Regards,
    Didi
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  5. Shalin
    Shalin avatar
    61 posts
    Member since:
    May 2015

    Posted 10 Feb in reply to Didi Link to this post

    hi,

    as i know "HelveticaNeue" is already in iOS, so i have not add it to iOS project. Anyway, i'll try adding just name to info.plist and try.

    but for record same use of font works fine in app, even inside other telerik controllers.

Back to Top