charri / Font-Awesome-WPF

FontAwesome controls for WPF+UWP
MIT License
530 stars 147 forks source link

Scaling down image messes with icon weights #33

Closed drewnoakes closed 7 years ago

drewnoakes commented 8 years ago

ImageAwesome internally renders the glyph at 100x100 px, then scales it down to the target size (assuming it's less than 100px).

However this messes with the font weights. Consider this example (from here):

image

At small sizes, the typeface designer provides hints on how to map lines and details to pixels. At larger sizes, the icon feels heavier. When you scale it down, it ends up looking bold, fuzzy and without sharp detail.

Instead, ImageAwesome should render at the required size, so no scaling occurs. The underlying Image.StretchDirection should have its metadata overridden, setting the default to StretchDirection.None.

Crisp icons at 96 DPI due to typeface hinting is one of the reasons to use fonts over the equivalent paths/geometry. By rendering the glyph at the wrong size, this benefit goes away.

charri commented 7 years ago

Cool, thanks for this! I'll look into getting this implemented.

charri commented 7 years ago

image

@drewnoakes the top images is rendering the icons on OnDraw to the current Height + Width of the Element. the 2nd image renders as "normal"

To me, they look the same?

drewnoakes commented 7 years ago

Those do look very similar :)

Have you tested on a high DPI screen? I can do that if you push code to a branch.

charri commented 7 years ago

fixed in v4.7