awesome-inc / FontAwesome.Sharp

A library for using Font Awesome in WPF & Windows Forms applications
Apache License 2.0
384 stars 89 forks source link

FontAwesome icon NOT vertically aligned on controls #43

Closed lordofscripts closed 3 years ago

lordofscripts commented 4 years ago

Source: NuGet Package: FontAwesome.Sharp Version: v5.13 Platform: Windows Forms desktop application

I am using the FontAwesome.Sharp NuGet on my .NET (C#) Winforms project. I have used it to show FA icons on ToolStripMenuItems and Buttons and noticed that the icon is NOT vertically aligned on System.Windows.Forms controls. When the icon is displayed on the control, the icon looks shifted down so it does not look 'awesome'.

mkoertgen commented 4 years ago

Hi @lordofscripts ,

Thanks for reaching out. It seems that gdi+ string measuring is not 100% accurate but i could improve it a bit.

image

Also updated fonts. Check with 5.14+

lordofscripts commented 4 years ago

Just updated to 5.14, I think some changes are needed in the FontAwesome.Sharp.IconPictureBox because the chosen icon is not centered in the IconPictureBox, is more like it is shifted upwards or up and to the right in the control. I was looking for some alignment properties but there was none.

mkoertgen commented 4 years ago

Hi @lordofscripts

Thanks for investigating. If you have time to spare a PR would be much appreciated.

lordofscripts commented 4 years ago

Yes, exactly as in #44

mkoertgen commented 4 years ago

I was able to tackle this. Not 100% fine with this. Will probably need some days to publish a new release

mkoertgen commented 3 years ago

It looks like most issues can be fixed by avoiding under-sampling. Some time ago we pinned the default icon size to 16 pixels which is way too low for modern devices where 96 dpi is the norm.

Upgrading the default icon size to 48.