SlideShare a Scribd company logo
1 of 29
SVG vs. Font
Mohammad Bayat
Ok.Bayat@Hotmail.com
December
2016
If you're building an icon system for a site,
you have some options. If you know the
icons need to be raster images, then you'll
likely be using CSS sprites. If the icons will
be vector images (much more common
these days), you have some options. Two
of those options are using inline SVG and
using icon fonts.
Let's compare.
Icons are
Vector*
resizable up and down without losing
quality, extra sharp on retina displays,
and small file size among them
*
Icons are Vector
Icon Font Inline SVG
Browsers consider it text, so the icons are anti-
aliased as such. Can lead to icons not being as
sharp as you might expect.
Straight up vector
CSS Control
CSS Control
Icon Font Inline SVG
You can control the size (via font-size), color,
shadows, rotation, etc. via CSS.
You have all the same CSS control as with a font,
but better, because you can 1) control individual
parts of a multi-part icon and 2) use SVG-specific
CSS like stroke properties.
CSS Control
Icon Font
<i class="fa fa-address-book" aria-hidden="true">
::befote
</i>
.fa-address-book:before {
content: "f2b9";
}
.fontawesome-icon-list .fa-hover a .fa {
font: normal normal normal 14px/1 FontAwesome;
font-size: 14px;
color: #222;
line-height: 32px;
white-space: nowrap;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
text-align: right;
-moz-ox-font-smoothing: grayscale;
display: inline-block;
width: 32px;
margin-right: 10px;
...
}
CSS Control
Inline SVG
<svg viewBox="0 0 480 480">
<g>
<path d="M460.33,146.509c-12.187-26.311-29.332-50.578-50.961 ..."></path>
<path d="M391.68,267.909H219.717V67.355c0.345-1.699,0.253-3. ..."></path>
...
</g>
...
</svg>
svg {
fill: #c8cac8;
transition: transform ease-in 0.2s;
}
path[Attributes Style] {
d: path('M460.33,146.509c-12.187-26.311-29.332-50.578-50.961 ... ‘)
stroke: green;
stroke-width: 4;
fill: yellow;
...
}
Positioning
Positioning
Icon Font Inline SVG
It can be frustrating to position a font icon. The
icons are inserted via pseudo element, and it
depends on line-height, vertical-align, letter-
spacing, word-spacing, how the font glyph is
designed (does it naturally have space around it?
does it have kerning information?). Then the
pseudo elements display type affects if those
properties have an effect or not.
SVG just is the size that it is.
See how the pseudo element box isn't quite
where the glyph actually is.
The SVG box is the size of the SVG.
Weird Failures
Weird Failures
Icon Font Inline SVG
An icon font might fail because 1) it's being
loaded cross-domain without the proper CORS
headers and Firefox doesn't like that 2) for any
reason, the font file fails to load (network hiccup,
server failure, etc) 3) There is some weird
Chrome bug that dumps the @font-face and
shows a fallback font instead 4) Surprising
browserdoesn't support @font-face.
Font failures are pretty common for a variety of
reasons. Plus, if you try and do something clever
like map icons to "Private Use Area" of unicode
and the font fails, it may do something really
weird like show an unexpected emoji, because
the environment you're in uses that same area
for emoji. Or that emoji might even overrule
your glyphs!
Inline SVG is right in the document. If the
browser supports it, it displays it.
Weird Failures
Icon Font
Weird Failures
Inline SVG
Forced Failures
Forced Failures
Icon Font Inline SVG
• Proxy browsers like Opera Mini or UC
Browser don't support @font-face at all,
even though they sometimes report that
they do. So even if you try to feature detect,
it may fail.
• Some people force their own fonts over
yours, for example in a user stylesheet or a
browser extension specifically for applying
custom styles. For instance, one that applies
a font better for people with dyslexia. (More
on the issues with icon font
accessibility from Seren D.)
• Blocking technology can either automatically
or offer to block custom fonts. (reference)
Even those proxy browsers support SVG. Blockers
don't care about SVG.
Ad blocker offering to totally block
custom fonts.
Forcing a different font upon a page can destroy
an icon font system.
Semantics
Semantics
Icon Font Inline SVG
To use responsibly, you're injecting the icon via a
pseudo element on an (empty) <span>. Either
bad or no semantics, depending on how you feel
about that kind of thing.
Icons are little images. The semantics
of <svg> says "I'm an image." Seems better to
me.
Accessibility
Accessibility
Icon Font Inline SVG
You have to be quite careful with icon fonts to
make sure you do it in an accessible way. You
should basically do everything in this article.
You're always fighting to make sure that the icon
itself isn't read (but something else is) and that
hard-to-detect fail states are handled.
I'm no expert, but research suggests using the
proper combination of elements and attributes
(<title>, <desc>, and aria-labelledby) you can
convey good information across the browser
specturm. Plus no weird fail states.
Ease of Use
Ease of Use
Icon Font Inline SVG
Using a pre-created icon font was never
particularly responsible (too many unused
icons). Creating your own icon font was never
overly comfortable. I think the best were Pictos
Server (limited to Pictos icons)
and IcoMoon (free login to save projects).
Fontello has an API I didn't see it used to make a
good build tool.
The inline SVG system is easier because you can
do it all by hand if needed. Or use a tool like
IcoMoon (exports either way). Or use a build
tool.
Browser Support
Browser Support
Icon Font Inline SVG
Very deep. Even IE 6.
Decent, but problems are IE 8- and Android 2.3-.
Fallbacks doable but not wonderful.
Winner
It all comes down to browser support. If you can go IE 9+ / Android 3+, inline SVG is
better at pretty much everything than icon fonts. If you need the deeper browser
support, I feel like an inline SVG fallback would be too big of a pain to be worth it
(maintaining a PNG copy, inserting an additional element to display PNG version, hiding
SVG element... it's weighty).
Thank you!
Mohammad Bayat
Ok.Bayat@Hotmail.com

More Related Content

Similar to Font icons vs inline svg - 2016

Building Axure Icon Widget Libraries Using Web Fonts
Building Axure Icon Widget Libraries Using Web FontsBuilding Axure Icon Widget Libraries Using Web Fonts
Building Axure Icon Widget Libraries Using Web FontsSvetlin Denkov
 
Switch Away from Icon Fonts to SVG
Switch Away from Icon Fonts to SVGSwitch Away from Icon Fonts to SVG
Switch Away from Icon Fonts to SVGExove
 
Vector Graphics on the Web: SVG, Canvas, CSS3
Vector Graphics on the Web: SVG, Canvas, CSS3Vector Graphics on the Web: SVG, Canvas, CSS3
Vector Graphics on the Web: SVG, Canvas, CSS3Pascal Rettig
 
Hooray Icon Fonts workshop
Hooray Icon Fonts workshopHooray Icon Fonts workshop
Hooray Icon Fonts workshopjameswillweb
 
Easy charting with
Easy charting withEasy charting with
Easy charting withMajor Ye
 
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin..."Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...Yandex
 
Serious Animation (an introduction to Web Animations)
Serious Animation (an introduction to Web Animations)Serious Animation (an introduction to Web Animations)
Serious Animation (an introduction to Web Animations)brianskold
 
Responsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and TechniquesResponsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and TechniquesVitaly Friedman
 
Responsive Web Design and SharePoint
Responsive Web Design and SharePointResponsive Web Design and SharePoint
Responsive Web Design and SharePointStefan Bauer
 
Rethinking accessibility related best practices for CSS in the modern age
Rethinking accessibility related best practices for CSS in the modern ageRethinking accessibility related best practices for CSS in the modern age
Rethinking accessibility related best practices for CSS in the modern ageshwetank
 
The Sankofa of CSS3: Moving forward while looking back
The Sankofa of CSS3: Moving forward while looking backThe Sankofa of CSS3: Moving forward while looking back
The Sankofa of CSS3: Moving forward while looking backDenise Jacobs
 
Ways to enhance accessibility in a SVG icon desing
Ways to enhance accessibility in a SVG icon desingWays to enhance accessibility in a SVG icon desing
Ways to enhance accessibility in a SVG icon desingIam Vector
 
Is the mobile web enabled or disabled by design?
Is the mobile web enabled or disabled by design?Is the mobile web enabled or disabled by design?
Is the mobile web enabled or disabled by design?Henny Swan
 
Building a game engine with jQuery
Building a game engine with jQueryBuilding a game engine with jQuery
Building a game engine with jQueryPaul Bakaus
 
S&T Ess Vee Gee 211016
S&T Ess Vee Gee 211016S&T Ess Vee Gee 211016
S&T Ess Vee Gee 211016Dan Dineen
 

Similar to Font icons vs inline svg - 2016 (20)

Building Axure Icon Widget Libraries Using Web Fonts
Building Axure Icon Widget Libraries Using Web FontsBuilding Axure Icon Widget Libraries Using Web Fonts
Building Axure Icon Widget Libraries Using Web Fonts
 
Switch Away from Icon Fonts to SVG
Switch Away from Icon Fonts to SVGSwitch Away from Icon Fonts to SVG
Switch Away from Icon Fonts to SVG
 
Vector Graphics on the Web: SVG, Canvas, CSS3
Vector Graphics on the Web: SVG, Canvas, CSS3Vector Graphics on the Web: SVG, Canvas, CSS3
Vector Graphics on the Web: SVG, Canvas, CSS3
 
Hooray Icon Fonts workshop
Hooray Icon Fonts workshopHooray Icon Fonts workshop
Hooray Icon Fonts workshop
 
Easy charting with
Easy charting withEasy charting with
Easy charting with
 
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin..."Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...
 
SVG 101
SVG 101SVG 101
SVG 101
 
Serious Animation (an introduction to Web Animations)
Serious Animation (an introduction to Web Animations)Serious Animation (an introduction to Web Animations)
Serious Animation (an introduction to Web Animations)
 
Website design2
Website design2Website design2
Website design2
 
Responsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and TechniquesResponsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and Techniques
 
Responsive Web Design and SharePoint
Responsive Web Design and SharePointResponsive Web Design and SharePoint
Responsive Web Design and SharePoint
 
Icon Themes
Icon ThemesIcon Themes
Icon Themes
 
Rethinking accessibility related best practices for CSS in the modern age
Rethinking accessibility related best practices for CSS in the modern ageRethinking accessibility related best practices for CSS in the modern age
Rethinking accessibility related best practices for CSS in the modern age
 
touch
touchtouch
touch
 
touch
touchtouch
touch
 
The Sankofa of CSS3: Moving forward while looking back
The Sankofa of CSS3: Moving forward while looking backThe Sankofa of CSS3: Moving forward while looking back
The Sankofa of CSS3: Moving forward while looking back
 
Ways to enhance accessibility in a SVG icon desing
Ways to enhance accessibility in a SVG icon desingWays to enhance accessibility in a SVG icon desing
Ways to enhance accessibility in a SVG icon desing
 
Is the mobile web enabled or disabled by design?
Is the mobile web enabled or disabled by design?Is the mobile web enabled or disabled by design?
Is the mobile web enabled or disabled by design?
 
Building a game engine with jQuery
Building a game engine with jQueryBuilding a game engine with jQuery
Building a game engine with jQuery
 
S&T Ess Vee Gee 211016
S&T Ess Vee Gee 211016S&T Ess Vee Gee 211016
S&T Ess Vee Gee 211016
 

Recently uploaded

Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 

Recently uploaded (20)

Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 

Font icons vs inline svg - 2016

  • 1. SVG vs. Font Mohammad Bayat Ok.Bayat@Hotmail.com
  • 3. If you're building an icon system for a site, you have some options. If you know the icons need to be raster images, then you'll likely be using CSS sprites. If the icons will be vector images (much more common these days), you have some options. Two of those options are using inline SVG and using icon fonts. Let's compare.
  • 4. Icons are Vector* resizable up and down without losing quality, extra sharp on retina displays, and small file size among them *
  • 5. Icons are Vector Icon Font Inline SVG Browsers consider it text, so the icons are anti- aliased as such. Can lead to icons not being as sharp as you might expect. Straight up vector
  • 7. CSS Control Icon Font Inline SVG You can control the size (via font-size), color, shadows, rotation, etc. via CSS. You have all the same CSS control as with a font, but better, because you can 1) control individual parts of a multi-part icon and 2) use SVG-specific CSS like stroke properties.
  • 8. CSS Control Icon Font <i class="fa fa-address-book" aria-hidden="true"> ::befote </i> .fa-address-book:before { content: "f2b9"; } .fontawesome-icon-list .fa-hover a .fa { font: normal normal normal 14px/1 FontAwesome; font-size: 14px; color: #222; line-height: 32px; white-space: nowrap; text-rendering: auto; -webkit-font-smoothing: antialiased; text-align: right; -moz-ox-font-smoothing: grayscale; display: inline-block; width: 32px; margin-right: 10px; ... }
  • 9. CSS Control Inline SVG <svg viewBox="0 0 480 480"> <g> <path d="M460.33,146.509c-12.187-26.311-29.332-50.578-50.961 ..."></path> <path d="M391.68,267.909H219.717V67.355c0.345-1.699,0.253-3. ..."></path> ... </g> ... </svg> svg { fill: #c8cac8; transition: transform ease-in 0.2s; } path[Attributes Style] { d: path('M460.33,146.509c-12.187-26.311-29.332-50.578-50.961 ... ‘) stroke: green; stroke-width: 4; fill: yellow; ... }
  • 11. Positioning Icon Font Inline SVG It can be frustrating to position a font icon. The icons are inserted via pseudo element, and it depends on line-height, vertical-align, letter- spacing, word-spacing, how the font glyph is designed (does it naturally have space around it? does it have kerning information?). Then the pseudo elements display type affects if those properties have an effect or not. SVG just is the size that it is. See how the pseudo element box isn't quite where the glyph actually is. The SVG box is the size of the SVG.
  • 13. Weird Failures Icon Font Inline SVG An icon font might fail because 1) it's being loaded cross-domain without the proper CORS headers and Firefox doesn't like that 2) for any reason, the font file fails to load (network hiccup, server failure, etc) 3) There is some weird Chrome bug that dumps the @font-face and shows a fallback font instead 4) Surprising browserdoesn't support @font-face. Font failures are pretty common for a variety of reasons. Plus, if you try and do something clever like map icons to "Private Use Area" of unicode and the font fails, it may do something really weird like show an unexpected emoji, because the environment you're in uses that same area for emoji. Or that emoji might even overrule your glyphs! Inline SVG is right in the document. If the browser supports it, it displays it.
  • 17. Forced Failures Icon Font Inline SVG • Proxy browsers like Opera Mini or UC Browser don't support @font-face at all, even though they sometimes report that they do. So even if you try to feature detect, it may fail. • Some people force their own fonts over yours, for example in a user stylesheet or a browser extension specifically for applying custom styles. For instance, one that applies a font better for people with dyslexia. (More on the issues with icon font accessibility from Seren D.) • Blocking technology can either automatically or offer to block custom fonts. (reference) Even those proxy browsers support SVG. Blockers don't care about SVG.
  • 18. Ad blocker offering to totally block custom fonts. Forcing a different font upon a page can destroy an icon font system.
  • 20. Semantics Icon Font Inline SVG To use responsibly, you're injecting the icon via a pseudo element on an (empty) <span>. Either bad or no semantics, depending on how you feel about that kind of thing. Icons are little images. The semantics of <svg> says "I'm an image." Seems better to me.
  • 22. Accessibility Icon Font Inline SVG You have to be quite careful with icon fonts to make sure you do it in an accessible way. You should basically do everything in this article. You're always fighting to make sure that the icon itself isn't read (but something else is) and that hard-to-detect fail states are handled. I'm no expert, but research suggests using the proper combination of elements and attributes (<title>, <desc>, and aria-labelledby) you can convey good information across the browser specturm. Plus no weird fail states.
  • 24. Ease of Use Icon Font Inline SVG Using a pre-created icon font was never particularly responsible (too many unused icons). Creating your own icon font was never overly comfortable. I think the best were Pictos Server (limited to Pictos icons) and IcoMoon (free login to save projects). Fontello has an API I didn't see it used to make a good build tool. The inline SVG system is easier because you can do it all by hand if needed. Or use a tool like IcoMoon (exports either way). Or use a build tool.
  • 26. Browser Support Icon Font Inline SVG Very deep. Even IE 6. Decent, but problems are IE 8- and Android 2.3-. Fallbacks doable but not wonderful.
  • 27. Winner It all comes down to browser support. If you can go IE 9+ / Android 3+, inline SVG is better at pretty much everything than icon fonts. If you need the deeper browser support, I feel like an inline SVG fallback would be too big of a pain to be worth it (maintaining a PNG copy, inserting an additional element to display PNG version, hiding SVG element... it's weighty).
  • 28.