B
B
Bogdan Gerasimenko2017-04-14 14:34:34
Fonts
Bogdan Gerasimenko, 2017-04-14 14:34:34

Why does Google Fonts only use Woff2?

I noticed a long time ago that Google Web Fonts uses only one woff2 font format in their css file:

/* cyrillic-ext */
@font-face {
  font-family: 'Comfortaa';
  font-style: normal;
  font-weight: 400;
  src: local('Comfortaa Regular'), local('Comfortaa-Regular'), url(https://fonts.gstatic.com/s/comfortaa/v9/Be0CkOtwwI2n86HMhtablRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
  unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
}

The same FontAwesome connects about 5 formats at once:
@font-face {
  font-family: 'FontAwesome';
  src: url('../fonts/fontawesome-webfont.eot?v=4.7.0');
  src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'), 
url('../fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'), 
url('../fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'), 
url('../fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'), 
url('../fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');
  font-weight: normal;
  font-style: normal;
}

At the same time, both options work on any device. Is it time to switch only to the woff2 format and who has already studied this issue?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Roman, 2017-04-14
@llgruff

Google Fonts checks the current browser in which the fonts are called and generates the optimal css for loading.
If, for example, the current chrome is used, then the fonts are given in woff2, if something is older then: woff or ttf, etc.

A
Alexey Ukolov, 2017-04-14
@alexey-m-ukolov

Is it time to switch only to woff2 format?

caniuse.com/#feat=woff2

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question