Closed JeffreyJamesAttenti closed 7 years ago
Borders (or strokes) are very problematic when dealing with scaling SVGs. You should be able to get the desired outcome by converting the border to a path (or in Illustrator terms "outline stroke"). This can be done in Inkscape by selecting your border path and selecting "Path" > "Stroke to Path" from the menus:
Here's the result of your provided svg:
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<path d="M50.15 20.395v471.89H463.2V20.395H50.15zm10 10H453.2v451.89H60.15V30.395z" color="#000" solid-color="#000000" white-space="normal"/>
<path d="M405.18 115.67c13.314-32.667 17.31-64-5.326-83.667l-144.12 192-16.976 23s-27.627 40.01-37.28 58.667-19.306 39.333-27.294 54c-7.01 12.87-10.438 15.22-14.322 11.548-.506-.59-1.026-1.168-1.553-1.736-.038-.047-.074-.09-.11-.138-1.144-1.472-2.75-3.002-4.636-4.467-9.36-8.07-21.01-12.87-33.64-12.87-30.883 0-55.92 28.65-55.92 64s25.037 64 55.92 64c25.282 0 46.635-19.205 53.553-45.56l-.004.042s13.355-41.483 32.66-71.483 49.597-43 49.597-43l31.954-32s104.18-139.67 117.5-172.33zM119.92 448c-15.418 0-27.918-14.353-27.918-32s12.5-32 27.918-32c15.42 0 27.918 14.353 27.918 32s-12.5 32-27.92 32zM256 288c-8.836 0-16-7.163-16-16 0-8.836 7.164-16 16-16 8.837 0 16 7.164 16 16 0 8.84-7.16 16-16 16z"/>
<path d="M207.28 265.26c9.18-14.114 17.67-26.43 18.304-27.346l.143-.208.15-.203 16.976-23 .038-.052.04-.05 2.94-3.92L111.9 32c-22.633 19.668-18.64 51-5.325 83.668 9.95 24.42 70.68 108.62 100.71 149.59zM391.83 352c-12.628 0-24.275 4.795-33.637 12.874-1.885 1.465-3.492 2.995-4.635 4.467-.037.05-.072.092-.11.14-.525.567-1.046 1.145-1.552 1.735-3.884 3.673-7.312 1.323-14.322-11.548-7.988-14.667-17.64-35.344-27.294-54-1.77-3.42-4.146-7.56-6.843-12.038-1.272 1.71-2.264 3.042-2.932 3.937l-.688.924-.813.816-28.688 28.73C280.75 334.89 294.88 346.31 305.622 363c19.305 30 32.66 71.482 32.66 71.482l-.004-.043c6.89 26.36 28.25 45.56 53.53 45.56 30.88 0 56.17-28.65 56.17-64s-25.29-64-56.17-64zm0 96c-15.42 0-27.918-14.353-27.918-32s12.498-32 27.918-32c15.418 0 27.918 14.353 27.918 32s-12.5 32-27.92 32z"/>
</svg>
Note: I also ran it thru SVGO to remove some cruft
Bonus Pro Tip: It's a common practice to keep an un-optimized "source" version of your icon (in SVG
or AI
format alongside the optimized version (with strokes and fonts outlined) so you can make changes more easily. Just be sure to only include the optimized ones in your Gruntfile.js
.
Thank you so much for taking the time to help me with my issue!
I don't know how to determine what webfont will convert as far as SVG elements so I'm at a loss on where to find a solution to my problem.
I have an SVG that I edited by adding a rectangle with a thick stroke and transparent fill to border the other paths. The border shows in SVG editors like inkscape but not when I process it into a font file with webfont. The other paths are visible but not the border. What can I do to make this work?
Here's the svg code:
In an editor![image](https://user-images.githubusercontent.com/942571/26844570-dc0be8da-4ac1-11e7-9957-24766e84f9e6.png)
After processing with webfont![image](https://user-images.githubusercontent.com/942571/26844599-f564b050-4ac1-11e7-8463-62d8c81fab7a.png)