2

I have some icon font files that have been generated with fontello which I want to add to my ionic 2 app.

Fontello produces files in the following formats:

eot, svg, ttf, woff, woff2

Can I get away with just using the svg or ttf files? Which format is recommended for ionic 2 apps?

The css for the font looks like this:

@font-face {
font-family: 'fontello';
src: url('../font/fontello.eot?85689097');
src: url('../font/fontello.eot?85689097#iefix') format('embedded-opentype'),
   url('../font/fontello.woff2?85689097') format('woff2'),
   url('../font/fontello.woff?85689097') format('woff'),
   url('../font/fontello.ttf?85689097') format('truetype'),
   url('../font/fontello.svg?85689097#fontello') format('svg');
font-weight: normal;
font-style: normal;
}

Can I simply remove the lines for the fonts I don't need?

Bill Noble
  • 6,466
  • 19
  • 74
  • 133
  • Whatever produces those formats for you should be ashamed of itself because except for woff/woff2 none of those formats are necessary. Or even supported by anything anymore. *or even exist as a spec anymore*. See http://stackoverflow.com/questions/36105194/are-eot-ttf-and-svg-still-necessary-in-the-font-face-declaration/36110385#36110385 – Mike 'Pomax' Kamermans Jan 20 '17 at 00:12
  • @Mike'Pomax'Kamermans there is nothing wrong with the addtion of backwards compatibility. There are definitely cases where one could use the .svg format –  Jan 20 '17 at 04:51
  • 1
    But there is everything wrong with wasting bandwidth for formats that aren't supported by anything anymore: `eot` is only for IE8 and below, and Microsoft *no longer supports* IE8 and below, and `svg` isn't a true font format, it was bad and we killed it (http://caniuse.com is helpful here). Also any browser that properly supports `ttf/otf` *also* supports `woff`, except better, so this has nothing to do with "backward compatibility" and everything with "it's not 2012 anymore, you literally just need WOFF, or if you also target IE8, which makes no sense, WOFF + eot", and that's it. That's all. – Mike 'Pomax' Kamermans Jan 20 '17 at 15:56
  • For ionic 2 I think ttf files work fine so I presume I can get rid of the rest? – Bill Noble Jan 20 '17 at 15:59

0 Answers0