3 ms·
I'm not an SVG expert, but surely that shouldn't be a 1.1 MB export? I just quickly created a text-based SVG image in Inkscape, and it was a few KB in size and
by amanzi 5y ago
I'm not an SVG expert, but surely that shouldn't be a 1.1 MB export?
I just quickly created a text-based SVG image in Inkscape, and it was a few KB in size and the text was all selectable. I couldn't even open the Carbon SVG export in Inkscape, so I'm not sure what it's doing?
- fermentation 5y agoYep the default example is a 1.1MB SVG. This website manages to inflate the original content over 3000x.
- oefrha 5y agoYou certainly didn't embed a >300KB font[1] in your few KB SVG image? If you don't embed the font, other people without the font will simply see something different. The uncompressed 1.1MB export isn't optimized for size since it repeats basically the same CSS styles over and over for every token. When gzipped (default level) it's 302KB, and when brotli'ed it's 290KB, basically the font takes all the space. Of course, technically it's possible to optimize the size by creating a custom font with only the glyphs needed, like what people used to do for icon fonts. [1] https://sourcefoundry.org/hack/ https://sourcefoundry.org/hack/
- dmitrygr 5y ago...or...the text just takes up a few hundred bytes...it is code, not an art project. "font: monospace" is good enough
- oefrha 5y agoThe myriad stylistic options including different types of functionally useless window controls and drop shadow clearly says it's partly an art project. If "it is code, not an art project" to you, the only thing I can say is you're not the target audience.
- vletal 5y agoWell you definitely can prune the font to ASCII. Enything outside of that can be exported as vector graphics. That would shave off plenty of space.
- kevincox 5y agoI don't think you can really export a font to SVG vector graphics if you want it to look good at low resolutions. You will lose all of the hinting information. The best option is probably glyph culling which should be not much larger, it may even be smaller in many cases.