3 ms·
Not web dev question - I'm curious, what is the advantage of using a font rather than images?
by shubb 12y ago
Not web dev question - I'm curious, what is the advantage of using a font rather than images?
- joeyspn 12y agoLess http petitions and bandwidth. Also, they are vector-based so are great for all resolutions and sizes.
- joeyspn 12y agoWhy is this being downvoted? Did I say anything false?
- rguldener 12y agoFont files are vector "images" which means your icons will scale gracefully to any size. This is probably the main advantage. Depending on the complexity I imagine fonts would also be smaller than corresponding bitmaps although I never actually checked.
- moron4hire 12y agoThey can also be recolored more easily, making themes easier to maintain.
- bitJericho 12y agoSVG are vector graphics that can be rendered in all modern browsers: http://caniuse.com/#feat=svg-img http://caniuse.com/#feat=svg-img You do miss out on the recoloring and any other font styling options though.
- angeNoble 12y agoActually you can style SVG with CSS #yourSVG { fill: red; stroke: blue; }
- bitJericho 12y agomind = blown
- yoshokatana 12y agoThe problem is that, until <svg use> is standardized and supported, the only way to style svg elements is if you include them in your markup (or use something like Iconic's SVG Injector). There's a tradeoff between inlining (or rather, including them server-side) and calling them as <img>, background-image, or fonts. The size, http requests, caching , and styling all play a role.
- basseq 12y agoI don't think you can re-style a SVG with CSS if you embed it with IMG. CSS styling has to be inline with the SVG, so you can embed it directly, or you can change CSS with JS.
- wil421 12y agoYou can change the color and size without having to change or edit an image. Plus things like pixelation dont happen with fonts but you could use canvas in a similar way. I've seen some cool logos done with canvas.