jsmarcus / Iconize

Use icon fonts in your Xamarin.Forms application!
Other
204 stars 71 forks source link

Fonts do not show #126

Open SharbelWired opened 5 years ago

SharbelWired commented 5 years ago

Hi everyone, I'm having an issue using the plugin. I've followed the setup instructions outlined here => https://github.com/jsmarcus/Iconize . The instructions are pretty straightforward, and I've checked it a dozen times, however when I try to use one of the controls, I either get a blank space where the icon should appear, or I get the text name of the icon that renders instead of the icon itself. I've searched this issue list and I have seen others struggle with the same issue, but I've not found a definitive answer on how to fix this.

I am focusing on Android right now, and am looking to use Font Awesome..

I'm running Xamarin.Forms v3.5.0.169047

Questions: 1) Assuming i am using the latest NuGet package (3.5.0.115), do I need to manually grab the ttf font files and place them in the Android Assets folder? I have tried that and ensured the build action was set to AndroidAsset, but it still did not work.

2) I am using Prism MVVM, are there known issues with Prism? I've not yet tried to get the icons in toolbars, I'm just adding IconImage to an existing view, are there issues with Prism and this plugin? [EDIT]: I tried a vanilla Xam Forms project without Prism and got the same results, so I do not think my issue is Prism.

3) The setup instructions say to include FA like this in app.xaml.cs

Plugin.Iconize.Iconize
                          .With(new Plugin.Iconize.Fonts.FontAwesomeModule());

however, this gives me a compile error since FontAwesomeModule is not found, I needed to do this instead:

Plugin.Iconize.Iconize
                .With(new Plugin.Iconize.Fonts.FontAwesomeRegularModule())
                .With(new Plugin.Iconize.Fonts.FontAwesomeBrandsModule())
                .With(new Plugin.Iconize.Fonts.FontAwesomeSolidModule());

Is the above correct?

Any hints would be greatly appreciated.

SharbelWired commented 5 years ago

OK, I downgraded the NuGet package to 3.5.0.114 and the icon shows properly in my vanilla xam forms project now. I think the latest version may have some regression?

[Edit]: Downgrading to 3.5.0.114 also fixed the issue in my Prism based (real) project.

awatertrevi commented 5 years ago

Could you perhaps share your vanilla project?

systembugtj commented 5 years ago

Sample project isn't working too. I clone the repo, and font-awesome and JamIcon won't show icon but text.

I use visual studio mac, open solution with visualstudio mac and run the iOS project.

ibovangeffen commented 5 years ago

Fixed the issue with #127 . new build should be on the way

BinaryReader84 commented 5 years ago

I have my custom font using IconModule. Since version 3.5.0.115~117 my icons stopped displaying correctly on Android (I only see the name of the font). If I downgrade to version 3.5.0.114, the font is displayed correctly.

Also I tried to use Xam.Plugin.Iconize.MaterialDesignIcons and in the same way I only see the name of the font in Android, in UWP I can see icons everywhere except in IconToolbarItem (I'm using IconNavigationPage).

juchunwei commented 5 years ago

I have the same issue, but it's till not work even I downgrade to 114, any idea? ......

SharbelWired commented 5 years ago

Another update, I tried my project on iOS and the fonts do not show, same issue as I had with the Android project. I updated just the iOS project to the newest version and it fixed the problem. If I updated the Core + Android though it causes android to break. So I am running 2 versions behind on core + android, and iOS on latest version.. it's the only way I can get it to work.

jsmarcus commented 5 years ago

What version of Android are you targeting?

BinaryReader84 commented 5 years ago

What version of Android are you targeting?

I'm using:

Minimum Android Version: Android 5.0 (API Level 21 - Lollipop) Target Android Version: Android 8.1 (API Level 27 - Oreo)

jsmarcus commented 5 years ago

Can you target API level 28 Pie?

jsmarcus commented 5 years ago

It is working with api 28. I'll have to see about multi-targeting for api 27 as well. If you can update your target it will be fixed faster. I understand if you cannot.

BinaryReader84 commented 5 years ago

It is working with api 28. I'll have to see about multi-targeting for api 27 as well. If you can update your target it will be fixed faster. I understand if you cannot.

I can not see the icons targeting API 27 (Android 8.1) using versions 3.5.0.117 of plugin, but as you mentioned, I have changed two options in Properties of the Android project: Application -> Compile using Android version (Target Framework) -> Android 9.0 (Pie) Application Manifest -> Target Android version -> Android 9.0 (API Level 28 - Pie)

Xam.Plugin.Iconize -> 3.5.0.117 Xam.Plugin.Iconize.MaterialDesignIcons -> 3.5.0.117

These changes fix the problem, now I can see the icons. Thanks.

jrcpereira commented 5 years ago

Icons stopped showing also on iOS. v3.5.0.118 not working on iOS.

Pirate911 commented 5 years ago

I'm having the same issue . It happens on IOS . I tried everything but it didn't work .

Xamarin.Forms 3.5.0.169047 Xam.Plugin.Iconize 3.5.0.117

Cheelax commented 5 years ago

Hi, Any workaround for that? no icon working on IOS and UWP for me.

softsan commented 5 years ago

Hi Same issue here. no icons show on iOS. any solution to this?

alialdemir commented 5 years ago

It doesn't work in ios app. When will you solve the problem?

mrutter commented 4 years ago

Hi, same issue here. Even the sample project (i.e. samples/Iconize.Sample.WPF) does not work: it shows text instead of the real icon.

@jsmarcus : do you have any solution?

Thank you very much.

UPDATE I removed everything and I just downloaded the master once again. On IconizeSamples, I updated Xamarin.Forms to v. 3.5.0.274416 and Xam.Plugin.Iconize.* to v. 3.5.0.129. Now I'm able to run the sample (I tried iOS only) and I can see many of the fonts (in particular FontAwesomeRegular, FontAwesomeSolid, Material, MaterialDesign and SimpleLineIcons). The WPF solution still doesn't work, but this is not a problem for me. I'm going to upgrade to Xamarin.Forms v. 4.4 and see what happen.