I was checking out Font Awesome and Bootstrap . Home They use a font scheme for icons:
In Awesome Font I saw the following files:
FontAwesome.otf fontawesome-webfont.eot fontawesome-webfont.svg fontawesome-webfont.ttf fontawesome-webfont.woff
I've heard a lot about vectorized images that allow a scalability without loss of quality and that is a very light source.
Well, all these files add up to approximately 592KB .
To try to understand a little more how this works, I made a very simple example with Awesome Font :
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Font Awesome</title>
<link href="/static/font-awesome-4.2.0/css/font-awesome.min.css" rel="stylesheet">
</head>
<body>
<div class="container body-content">
<h4><i class="fa fa-flag"></i> One Font, 479 Icons</h4>
<h4><i class="fa fa-microphone"></i> Free, as in Speech</h4>
<h4><i class="fa fa-gamepad"></i> Plays Well with Others</h4>
</div>
</body>
</html>
What generated:
AndbyanalyzingtheGoogleChrometoolsIcouldseethatonlythefontawesome-webfont.woffwasloaded.
So, in this conversation I had where they tried to explain to me, they said ico-fonts are in the svg file, in this case, fontawesome-webfont.svg .
At the moment I can not remember which and where, but I downloaded a package that contained only .svg files and each file contained only one icon . One of the ways I found to use them was tagged <img>
, but both Awesome Font and Bootstrap use something like:
.fa-arrows-v:before {
content: "\f07d";
}
.fa-arrows-h:before {
content: "\f07e";
}
5.1 What are the advantages of using it that way?
5.2 Having a css file with multiple declarations does not mean having too much unnecessary loading, ie are all the icons listed in the css file loaded for the client even though it will only use one? Or will every icon-fonts file ever be fully loaded anyway?
My biggest concern is performance.