Skip to content

Unhandled Exception while using FontAwesomeWeb (ttf) version 5.3.1 #45

@npagare

Description

@npagare

Describe the bug
Hi @wilsonvargas, thank you for helping us with this great plugin.
To make use of font icons from the latest version (53.1) of FontAwesomeWeb (ttf) filesI updated the my App's info.plist file as below.

fa-solid-900.ttf
fa-regular-400.ttf
fa-brands-400.ttf
MaterialIcons-Regular.ttf

But while testing my changes with ButtonCirclePlugin using FontAwesomeWeb v5.3.1 I am getting unhandled exception error as shown below.

Can you please confirm if your codebase is tied only to your version of the Font Awesome and Material ttf files?
<cFAB:CircleButton
IsVisible="True"
Grid.Row="0"
Grid.Column="1"
x:Name="fabRound"
FontIcon="FontAwesome" <=== this is a as is enum from your code. How does it read
the key value from about updates in the info.plist?
It doesn't throw any error when using around
MaterialIcon even when my value in the info.plist is
as shown above

Icon="fa-bed"
FontSize="15"
TextColor="WhiteSmoke"
HeightRequest="35"
WidthRequest="35"
BorderThickness="5"
BorderColor="Red"
BackgroundColor="White"
Clicked="Clicked"/>

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...' Download latest FontAwesomeWeb v5.3.1 font file

  2. Click on '....' unzip the downloaded file. Copy all 3 ttf files from {downloadfolder\fontawesome-free-5.3.1-web\fontawesome-free-5.3.1-web\webfonts} in your iOS app's resources folder.
    Use https://github.com/smourier/FontAwesomeEnum to create a fontAwesomeWeb Enum class.
    I have a attached .cs file that has new enums and literals defined for version 5.3.1. Remove the .txt extension to get to .cs file.
    FontAwesomeWeb531Font.cs.txt

  3. Scroll down to '....' Update your info.plist as shown above
    3.1 in App.xaml include following resource declarations

    <Application.Resources>

     <ResourceDictionary>
         <OnPlatform 
     		x:Key="FontAwesomeWeb531SIconsFontFamily" 
             x:TypeArguments="x:String"
     		Android="fa-solid-900.ttf#FontAwesome5FreeSolid"
     		iOS="FontAwesome5FreeSolid" />
    
         <OnPlatform 
     		x:Key="FontAwesomeWeb531RIconsFontFamily" 
             x:TypeArguments="x:String"
     		Android="fa-regular-400.ttf#FontAwesome5FreeRegular"
     		iOS="FontAwesome5FreeRegular" />
    
         <OnPlatform 
     		x:Key="FontAwesomeWeb531BFontFamily" 
             x:TypeArguments="x:String"
     		Android="fa-brands-400.ttf#FontAwesome5BrandsRegular"
     		iOS="FontAwesome5BrandsRegular" />
    
         <OnPlatform 
     		x:Key="MaterialIOIconFontFamily" 
             x:TypeArguments="x:String"
     		Android="MaterialIcons-Regular.ttf#MaterialIcons-Regular"
     		iOS="MaterialIcons-Regular" />
    
           </ResourceDictionary>
     </Application.Resources>
    
  4. See error - see the screenshot below

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.
image

Please complete the following information:

  • Which version of the ButtonCircle do you use? 2.0.3
  • Which version of Xamarin.Forms do you use? 3.2 pre2
  • Which OS are you talking about? iOS 11.14

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions