Iconize icon indicating copy to clipboard operation
Iconize copied to clipboard

FontAwesome in sample app on iOS not working

Open john-dalsgaard opened this issue 6 years ago • 43 comments

And the same goes for the icons in the title bar to the right (they show as a small rectangle with a question mark inside).

john-dalsgaard avatar Sep 19 '18 14:09 john-dalsgaard

I figured it out. For iOS, for font awesome, You have to add fonts manually to resourced folder. then add the reference for those in info.plist . This is actually better since you can add the version of the font you want instead of Iconize adding it for you. As for the sample project, I think They forgot to update that portion of it

pakbaz avatar Sep 19 '18 15:09 pakbaz

Thanks - I'll try that out!

john-dalsgaard avatar Sep 19 '18 15:09 john-dalsgaard

@pakbaz Have you tried to use the tabbar at the bottom in Android (new in Forms 3.1)?

It does funny things with the icons in my app when I try that (colours etc.)

john-dalsgaard avatar Sep 19 '18 15:09 john-dalsgaard

@pakbaz So in the test app I added these font files (with BuildAction -> BundleResource):

  • fa-brands-400.ttf
  • fa-regular-400.ttf
  • fa-solid-900.ttf

But they still don't show up.

The references in info.plist are already there as per the instructions.

What did you do differently?

john-dalsgaard avatar Sep 19 '18 15:09 john-dalsgaard

@john-dalsgaard

On IOS, try using .otf files from https://github.com/FortAwesome/Font-Awesome/tree/master/use-on-desktop

ClausElmann avatar Sep 19 '18 19:09 ClausElmann

The .ttf files are the correct files but Iconize is expecting them to be named the following:

iconize-fontawesome-brands.ttf iconize-fontawesome-regular.ttf iconize-fontawesome-solid.ttf

From: ClausElmann [email protected] Sent: Wednesday, September 19, 2018 3:28 PM To: jsmarcus/Iconize [email protected] Cc: Subscribed [email protected] Subject: Re: [jsmarcus/Iconize] FontAwesome in sample app on iOS not working (#83)

@john-dalsgaardhttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fjohn-dalsgaard&data=02%7C01%7C%7C00235610e9d643096fc408d61e6606d0%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636729820872965606&sdata=bPG2fadhEFsIxjf3E3%2BcpScpZy8benJKH2YQSC26kUU%3D&reserved=0

On IOS, try using .otf files from https://github.com/FortAwesome/Font-Awesome/tree/master/use-on-desktophttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FFortAwesome%2FFont-Awesome%2Ftree%2Fmaster%2Fuse-on-desktop&data=02%7C01%7C%7C00235610e9d643096fc408d61e6606d0%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636729820872965606&sdata=ZJI7ziBrEsw8t75AEOHZnirixtJjgIR8cqDk%2B3oz%2FgA%3D&reserved=0

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fjsmarcus%2FIconize%2Fissues%2F83%23issuecomment-422928993&data=02%7C01%7C%7C00235610e9d643096fc408d61e6606d0%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636729820872965606&sdata=8btjbcPvX4k5l%2BedgNTgaKSzPPjO8f9GYLEU5mjiBV4%3D&reserved=0, or mute the threadhttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAB1LIDXpQcdbI4_T68xs-wwqPfgViKeFks5ucprCgaJpZM4WwWrj&data=02%7C01%7C%7C00235610e9d643096fc408d61e6606d0%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636729820872965606&sdata=jyNQVbCfJk8XhQU9bI%2BFRu5BOUV8YqS8ZWGJiRvrc%2B8%3D&reserved=0.

jsmarcus avatar Sep 19 '18 19:09 jsmarcus

@jsmarcus

Strange - my app on IOS did not work with .ttf (renamed as stated above), only when I found the .otf version it was fixed :-) Android seems to work with both types

ClausElmann avatar Sep 19 '18 19:09 ClausElmann

It worked - but I had to use the .otf files as well as rename them as @jsmarcus mentioned.

After each change of files I cleaned the project and then ran it in debug mode on the simulator. Not sure if I should have done that differently?

john-dalsgaard avatar Sep 20 '18 06:09 john-dalsgaard

Does anyone happen to have an actual working sample for iOS? I think I tried every combination posted here and nothing works. I would love to see a working version if someone would not mind posting it.

AbeHamade avatar Oct 02 '18 21:10 AbeHamade

This is what I assumed to work:

In the info.plist file add:

<array> <string>iconize-entypoplus.ttf</string> <string>iconize-fontawesome-regular.otf</string> <string>iconize-fontawesome-solid.otf</string> <string>iconize-fontawesome-brands.otf</string> <string>iconize-ionicons.ttf</string> <string>iconize-material.ttf</string> <string>iconize-meteocons.ttf</string> <string>iconize-simplelineicons.ttf</string> <string>iconize-typicons.ttf</string> <string>iconize-weathericons.ttf</string> </array>

Use the otf files downloaded from: HERE

Rename them accordingly:

iconize-fontawesome-brands.otf iconize-fontawesome-regular.otf iconize-fontawesome-solid.otf

also tried....

iconize-fontawesome-brands.ttf iconize-fontawesome-regular.ttf iconize-fontawesome-solid.ttf

Place them in iOS Application Resources directory set to BundledResource.

Test Form uses:

<iconize:IconLabel FontSize="Large" VerticalOptions="Center" Text="fab-apple"/>

Clean All, Build, Deploy.

Result is no icon show, just the raw text.

AbeHamade avatar Oct 02 '18 21:10 AbeHamade

Same problem here Thanks!

matteopiccioni avatar Oct 06 '18 17:10 matteopiccioni

I was finally able to get this to work on iOS by downloading the Fontawesome otf files. Renaming them to iconize-fontawesome-regular/solid/brands.otf and adding them as a bundle resource in the project. Is this by design? Will this be a manual update whenever Fontawesome releases an update?

cklenk avatar Oct 19 '18 20:10 cklenk

Not working for me with IconImage in iOS on Android works fine but not in iOS. Can someone fix this ?

sidatacom avatar Nov 01 '18 23:11 sidatacom

It's not working for me either in ios . I updated to latest lib .

Pirate911 avatar Nov 09 '18 22:11 Pirate911

You have to add the ttf files manually in the iOS project in Resources (BundleResource). You also have to change the info.plist to the following:

<key>UIAppFonts</key>
<array>
    <string>iconize-fontawesome-brands.ttf</string>
    <string>iconize-fontawesome-regular.ttf</string>
    <string>iconize-fontawesome-solid.ttf</string>
</array>

Suplanus avatar Nov 13 '18 12:11 Suplanus

.ttf ?? i added the .otf files ??? Why .ttf ?

sidatacom avatar Nov 13 '18 12:11 sidatacom

I think it can also work with otf files. But ttf is the default.

Suplanus avatar Nov 13 '18 12:11 Suplanus

Hi All,

I have hit the same issues as this thread, but its long and picking the solution was confusing, here is what worked for me on VS for MAC, thanks to all above who helped.

  1. Download .OTF files from https://github.com/FortAwesome/Font-Awesome/tree/master/use-on-desktop

  2. Rename them to TTF (yes change the extension!) as follows -

iconize-fontawesome-brands.ttf iconize-fontawesome-regular.ttf iconize-fontawesome-solid.ttf

I assume we could just get them from here too - https://github.com/jsmarcus/Iconize/tree/master/src/Fonts/Plugin.Iconize.FontAwesome

  1. Add them to Resources folder and BundleResource build action.

  2. Update plist -

<key>UIAppFonts</key>
<array>
    <string>iconize-fontawesome-brands.ttf</string>
    <string>iconize-fontawesome-regular.ttf</string>
    <string>iconize-fontawesome-solid.ttf</string>
</array>
  1. Go!

And thanks for a great library.

wickedw avatar Nov 27 '18 12:11 wickedw

Try this:
https://ianvink.wordpress.com/2019/01/24/fontawsome-pro-in-xamarin-forms-apps/

ianvink avatar Jan 24 '19 18:01 ianvink

Thanks for an interesting article @ianvink.

However, and this may be due to my lack of knowledge, I would have liked to see an example of how you used the icons in your forms code using the helper class that you created. Specifically, I was looking for how to specify the icon name in the helper class?

john-dalsgaard avatar Jan 24 '19 21:01 john-dalsgaard

Was anyone able to get this working? I'm struggling with the same issues and it seems that it is only font awesome that is not working.

Tuytje avatar Feb 05 '19 11:02 Tuytje

Did anyone get this to work? I tried all of the above. It would be really nice if someone who got it to work could update the sample.

awatertrevi avatar Feb 22 '19 11:02 awatertrevi

hi @awatertrevi

I did this: https://github.com/jsmarcus/Iconize/issues/124#issuecomment-461461135

I hope it helps you. It worked perfectly in my project.

Wallysantos avatar Feb 22 '19 14:02 Wallysantos

Hi @Wallysantos,

I replicated the steps you mentioned, but unfortunately everything still appears as a question mark.

awatertrevi avatar Feb 25 '19 08:02 awatertrevi

It also seems that the Jam Icons is broken too.

awatertrevi avatar Feb 25 '19 08:02 awatertrevi

So it was working on iPhone XS Max simulator but not iPhone 6s.

I followed instructions and downloaded the tff files here: https://github.com/jsmarcus/Iconize/tree/master/src/Fonts

Then included it in the Resources folder in Xamarin.iOS and it is working now.

flamecrow avatar Feb 25 '19 18:02 flamecrow

I had the same issue using ttf files and references, but it is now working for me after adding the otf files in iOS' Resources folder and changing the references in Info.plist to .otf as well.

Files in Resources folder: iconize-fontawesome-brands.otf iconize-fontawesome-regular.otf iconize-fontawesome-solid.otf

References in Info.plist: UIAppFonts iconize-fontawesome-brands.otf iconize-fontawesome-regular.otf iconize-fontawesome-solid.otf

DuncanMcIntyre avatar Mar 07 '19 23:03 DuncanMcIntyre

One thing to remember when dealing with iOS, PLEASE make sure you get the latest versions of the fonts from Font Awesome's site. I've been bashing my head over and over and over after updating to the latest version of the plugin, and realized that I was still using Font Awesome v4 fonts. As soon as I downloaded the latest, renamed them as every comment explained (including the extension change to ttf), and added them in Info.plist, it all worked.

Another tip: If you rename the extension from .otf to .ttf from WITHIN Visual Studio, it automatically changes the Build Action to None. Be sure to go through and change each one back to BundleResource

snickler avatar Mar 18 '19 02:03 snickler

In 3.4 it works. If i update to 3.5 nothing is showing

Suplanus avatar Mar 18 '19 14:03 Suplanus

@Suplanus - Make sure your actual font files are updated from the Font Awesome repo. I just tried this on 3.5 last night and finally got it working (on iOS at least)

snickler avatar Mar 18 '19 14:03 snickler