elm-font-awesome icon indicating copy to clipboard operation
elm-font-awesome copied to clipboard

Reddit logo is chopped off on the sides.

Open TheSeamau5 opened this issue 9 years ago • 8 comments

It seems that at all sizes, the reddit logo is chopped off on the sides. It is due to how the svg width and height are set. If you manually increase the width, then the logo appears whole.

TheSeamau5 avatar Jun 11 '15 19:06 TheSeamau5

Thanks for the report, I assumed they were all the same size, I guess that's not the case

jacobstanley avatar Jun 11 '15 21:06 jacobstanley

Hmm, it's quite odd, if I check the source svg, it has the same width/height/viewBox as all the other images, namely 1792.

jacobstanley avatar Jun 15 '15 12:06 jacobstanley

I believe the same thing happens with toggle_on and toggle_off. Both clipped on both sides.

jterbraak avatar Jun 21 '15 14:06 jterbraak

It is also the case with newspaper_o. I think the idea would be to tweak the width/height/viewBox parameters appropriately to accomodate for the weird cases. In order not to add in API complexity, rather than exposing a second paramter for width and height, you can consider the input size as a maximum. Basically, the svg icon should live in a square and the icon would be fitted to the square.

TheSeamau5 avatar Jul 30 '15 04:07 TheSeamau5

@TheSeamau5 yeah that would be ideal, I think that the best fix would be if we can fix the svgs upstream so that they stay within their viewBox, this is the code that is generating them: https://github.com/encharm/Font-Awesome-SVG-PNG/blob/master/lib/getIconSvg.js

jacobstanley avatar Jul 30 '15 22:07 jacobstanley

Seems like this has been fixed upstream: https://github.com/encharm/Font-Awesome-SVG-PNG/issues/48

Would be nice to get an updated version :smile: (I'm using your library here, it's great)

Zinggi avatar Mar 01 '18 14:03 Zinggi

I recently did a a new release (https://github.com/jystic/elm-font-awesome/pull/10), give it a shot!

jacobstanley avatar Mar 02 '18 05:03 jacobstanley

We'll I'm using that version. So it seems like This still isn't fixed.

Here is a demo of my library, which uses version 3.0.0 of your library. As you can see, many icons are chopped off. It looks like the path goes out of the viewBox. By changing the viewBox parameters I can get it to center, so this seems to be possible to fix here. It seems like you always use 0 0 512 512 as viewBox, but upstream seems to be using a variable viewBox size: https://github.com/encharm/Font-Awesome-SVG-PNG/blob/master/lib/getIconSvg.js#L56

Zinggi avatar Mar 02 '18 10:03 Zinggi