3 ms·
When you want an icon that isn't one color (font-base icons like Font Awesome or using Unicode), or when you require a graphic with a high amount of detail. The
by coderdude 14y ago
When you want an icon that isn't one color (font-base icons like Font Awesome or using Unicode), or when you require a graphic with a high amount of detail. There isn't really a good, cross-browser solution for that that I'm aware of. SVG works to some extent but I don't think it's very easy to work with. Another instance where image-based icons win over font-based icons is when the icon has a lot of small detail. Like a shopping cart (that isn't just a solid, but has the little lines) or an icon representing a list. The lines look imbalanced or one will be thicker than the other. I'm sure this is different across operating systems and browsers but the problem exists. Though you can fix that by never using those icons at a small size.
Edit:
One thing I hadn't thought of that was brought up by another commenter is that some people override the fonts used in a site's stylesheets and force only their font preference to be used (mostly for readability). This would mess with font-based icons. I can't think of a way to detect this but it's something to consider when choosing font-based icons. Maybe JavaScript betrays the actual font being used and you can detect and patch it at run-time for those users.
- JackC 14y agoYou could potentially detect it in Javascript (if there's no better way) by measuring the width of an off-screen element -- especially if you added a ridiculously-wide glyph to your icon font. Like "if this div isn't at least 3 times as wide as it is tall, my icons aren't rendering properly."