MartinTopfstedt / FontAwesome5

WPF controls for the iconic SVG, font, and CSS toolkit Font Awesome 5.
MIT License
120 stars 23 forks source link

Not All Icons Work? #15

Closed Robmeister89 closed 3 years ago

Robmeister89 commented 5 years ago

I am getting this a square box instead of an icon for some of them when attempting to use the icon as the content of a button. FontAwesome_NotWorking

MartinTopfstedt commented 5 years ago

ok, let me check this. If i add this to the example app the icon works on the button in .net 4. I didn't specify the FontFamily though,

image

Robmeister89 commented 5 years ago

Okay, so it is definitely working in your app. What am I doing wrong? What steps am I supposed to take to use the icon as the button content?

MartinTopfstedt commented 5 years ago

Have you tried to remove the FontFamily?

Robmeister89 commented 5 years ago

Yes, unfortunately the others (for some reason or another) only work with it in place?

Robmeister89 commented 5 years ago

So a little update on this front... I have removed the FontFamily and placed the icon in the Button.Content as ImageAwesome Icon="Regular_UserCircle" and it works... not sure what's going on with the inline stuff but there is a small work around that I have discovered.

MartinTopfstedt commented 5 years ago

Ok good to hear. I will have a look at the attached property, if i remember correctly it sets the font familiy too.

Could you tell me an icon which didnt worked for you without the font family?

MartinTopfstedt commented 5 years ago

ok, i had a look in the code the attached property is setting the FontFamily according to the set Icon, you you don't need to set the FontFamily directly. I guess you have the FontAwesome otf's installed on your PC and if you specified the FontFamily it took the font from you PC instead of the otf files which are included in the library.

In the example, it looks like every icon works on the button if i don't specify the FontFamily.

Is you project a .Net or .Net Core project?

Robmeister89 commented 5 years ago

It is .net

chucker commented 4 years ago

@Robmeister89 that screenshot shows the VS XAML designer, which is known to have problems with embedded fonts.

Do you also have issues at runtime?

Robmeister89 commented 4 years ago

So I no longer do it like this. I now use this method:

And it always works at runtime but its always a square instead of an image when viewing it in XAML. I have just learned to live with it lol. I use this method because it takes the style of the textblock so it changes styles with button hovers, etc.