4
I was just taking a peek at Font Awesome and in the Bootstrap.
They use a font scheme for icons:
On Font Awesome I saw the following files:
- Fontawesome.otf
- fontawesome-Webfont.eot
- fontawesome-Webfont.svg
- fontawesome-Webfont.ttf
- fontawesome-Webfont.Woff
I heard a little talk about vector images that allow a resizing without loss of quality and that being a kind of source is also very light.
Good, 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 the Font Awesome:
<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>
That spawned:
And looking through the tools of Google Chrome I could see that of these files was loaded only the fontawesome-Webfont.Woff.
So, in this conversation that I had where they tried to explain to me, they said that the ico-fonts are in the file svg, in the case, fontawesome-Webfont.svg.
- What is each file of these?
- What is the advantage of using ico-fonts (if the term is wrong, I am referring to the method used by Font Awesome and which seems to be the same used by Bootstrap)?
- What are the disadvantages?
- Because only the file fontawesome-Webfont.Woff was loaded.
At the moment I can’t remember which and where, but I downloaded a package that contained only files . svg and each file contained only one icon. One of the ways I found to use them was with the tag
<img>
, but both Font Awesome 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 in this way?
5.2 Having a css file with multiple statements like this doesn’t mean having too much unnecessary loading, that is, are all the icons listed in the css file uploaded to the client even though it will only use one? Or every icon-fonts file will always be loaded full even?
My main concern is performance.
If you want to edit your reply, Chrome has loaded the font that barks (Woff)
– Bruno Augusto
@Brunoaugusto I edited and complemented my reply. Thank you.
– João Paulo Fricks
A question: No item 4, be in Windows environment can influence the source? Wouldn’t be only the type of font used by Internet Explorer?
– Renan Gomes
@Influence in what sense?
– João Paulo Fricks