Declined
Last Updated: 24 Jul 2019 08:18 by ADMIN
Precise Software Solutions
Created on: 19 Jul 2019 18:03
Category: Entry
Type: Bug Report
0
Custom Font in RadEntry causes crash on Xamarin iOS

Any version of Xamarin.Forms, the iOS version of the application crashes when attempting to apply a custom font "parameter descriptor cannot  be null"  

 

With this resource defined, and the OpenSans-Bold.ttf is in the Resources directory, marked as bundle resource...

<OnPlatform x:TypeArguments="x:String" x:Key="BoldFont">
    <On Platform="Android" Value="OpenSans-Bold.ttf#Open Sans" />
    <On Platform="iOS" Value="OpenSans-Bold" />
 </OnPlatform>


And using this code for the style (created from the Telerik login view template, with some modifications):

 


    <Style x:Key="LoginEntryStyle"
           TargetType="telerikInput:RadEntry">
        <Setter Property="TextColor"
                Value="{StaticResource DarkTextColor}" />
        <Setter Property="WatermarkTextColor"
                Value="{StaticResource LightBlueColor}" />
        <Setter Property="FontSize"
                Value="14" />
        <Setter Property="FontFamily"
                Value="{StaticResource BoldFont}" />
        <Setter Property="HeightRequest"
                Value="48" />
        <Setter Property="Margin"
                Value="0,0,0,16" />
        <Setter Property="BorderStyle">
            <Setter.Value>
                <telerikInput:BorderStyle BorderColor="{StaticResource LightBlueColor}"
                                          BorderThickness="1"
                                          CornerRadius="8" />
            </Setter.Value>
        </Setter>
    </Style>


3 comments
ADMIN
Didi
Posted on: 24 Jul 2019 08:18
Hello Julie,

Here are my points regarding the issue with the RadEntry custom font:

1) On iOS:

When FontFamily is assigned in XAML, the following exception is raised:

Unhandled Exception:
System.ArgumentNullException: Value cannot be null.
Parameter name: descriptor

You could try set the FontFamily dynamically after the view loads (in OnAppearing or a button click).

2) On Android: 

Custom font is never applied, in XAML or later in lifecycle using C#,the RadEntry uses the the default system font.

3) On UWP:

Both XAML and dynamically assigned custom fonts work as expected.

I will change this Feedback item's status to Declined as this issue is already logged in our Feedback portal: 
https://feedback.telerik.com/xamarin/1366499-radentry-custom-font-not-applied

Regards,
Didi
Progress Telerik
ADMIN
Lance | Senior Manager Technical Support
Posted on: 19 Jul 2019 22:36
Hi Julie,

I wanted to follow up to let you know that I was able to replicate the exception when setting the FontFamily property. I've locked this bug report open so that the dev team can review my repro and set a status.

Ultimately, no workaround is available because the RadEntry doesn't yet support custom fonts. In the meantime, please take a moment to up-vote the Feature Request so that your vote helps increase the priority for the feature.

I have updated your Telerik Points for bringing this to our attention, please accept my apologies for any inconvenience this has caused.

Regards,
Lance | Technical Support Engineer, Principal
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
ADMIN
Lance | Senior Manager Technical Support
Posted on: 19 Jul 2019 19:01
Hello Julie,

At this time, the RadEntry doesn't support custom fonts. You can up-vote the Feature Request here: https://feedback.telerik.com/xamarin/1366499-radentry-custom-font-not-applied 


That being said, it shouldn't crash with a NullReferenceException. If it's only happening in iOS I don't believe it's a missing resource file problem (it should just be ignored as well). I'll attempt to reproduce using your code. If it is a product issue, I'll pass it on to the development team to mitigate when they begin working on the feature.

Regards,
Lance | Technical Support Engineer, Principal
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