Next Arabic custom font family not works in iOS

saravananMadheswaransaravananMadheswaran Member ✭✭
edited September 20 in Xamarin.Forms

I have used custom font family in my application, Next Arabic font family not works in iOS, working fine in android.
Code snippet:
<ContentPage.Resources>
<ResourceDictionary>
<OnPlatform x:TypeArguments="x:String" x:Key="NormalFont">
<On Platform="iOS" Value="Cocon® Next Arabic" />
<On Platform="Android" Value="NextArabic.otf#Cocon® Next Arabic"/>
</OnPlatform>
</ResourceDictionary>
</ContentPage.Resources>

. . .

`<StackLayout>`         
`<Label Text="Hello" HorizontalTextAlignment="Center" VerticalOptions="CenterAndExpand" FontSize="20" FontFamily="{StaticResource NormalFont}"/>`         
`<Label Text="Xamarin Forms" HorizontalTextAlignment="Center" VerticalOptions="CenterAndExpand" FontSize="25" FontFamily="{StaticResource NormalFont}"/> `        
`<Label Text="Hellow Wrold" HorizontalTextAlignment="Center" VerticalOptions="CenterAndExpand" FontSize="20" FontFamily="{StaticResource NormalFont}"/>`  
 `</StackLayout>`

i have attached sample and images
android:

iOS

Best Answer

Answers

  • Hi ColeX

    Can you post the file of the solution after changing the font type from otf to ttf?

  • ColeXColeX Member, Xamarin Team Xamurai

    @nezar1002010 said:
    Hi ColeX

    Can you post the file of the solution after changing the font type from otf to ttf?

    Download the project @saravananMadheswaran provided , change the font file from otf to ttf ,add to project again .

  • I have change the font type to ttf in iOS project, but still it did not work.

  • changing font family name alone is works for me.

    <OnPlatform x:TypeArguments="x:String" x:Key="NormalFont">
    <On Platform="iOS" Value="CoconNextArabic-Light"/>
    <On Platform="Android" Value="NextArabic.otf#Cocon® Next Arabic" />
    </OnPlatform>

    Regards,
    Saravanan.

Sign In or Register to comment.