Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does removing woff2 in @font-face solve IE11 problems

I had troubles with a @font-face these days. My font was not displaying in IE11, but in all others.

Turned out that removing the "woff2" font solved my problems and the font displayed normally.

My question now is: Why could that be the solution? What is going on in IE11s mind, that removing a simple "woff2" tag could be the answer? I mean, normally I read about .htaccess files and other things which are really not easy to find out...

Does IE11 try to load the woff2 first?

like image 969
Mentenyia Avatar asked Nov 10 '16 15:11

Mentenyia


People also ask

Is WOFF2 supported in IE?

Fonts are provided in WOFF and WOFF2 format, which collectively cover all major browsers: Chrome (on desktop and iOS/Android), Firefox, Safari (on Mac and iOS), Internet Explorer, Edge, and others.

Should I use WOFF2?

It compresses the files and is supported by all modern browsers. Web Open Font Format 2 (WOFF2): WOFF2 is an update to the original WOFF format. Developed by Google, this is considered the best format of the bunch because it offers smaller file sizes and better performance for modern browsers that support it.

Do you need WOFF and WOFF2?

It is a World Wide Web Consortium Recommendation and is clearly the future of font formats. WOFF2 is the next generation of WOFF. The WOFF2 format offers a 30% average compression gain over the original WOFF. Because it still just a recommended upgrade, it does not have the wide support of WOFF.


1 Answers

IE 11 use woff instead of woff2. If you want maximum compatibility use this:

@font-face {
  font-family: 'MyWebFont';
  src: url('webfont.eot'); /* IE9 Compat Modes */
  src: url('webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
       url('webfont.woff2') format('woff2'), /* Super Modern Browsers */
       url('webfont.woff') format('woff'), /* Pretty Modern Browsers */
       url('webfont.ttf')  format('truetype'), /* Safari, Android, iOS */
       url('webfont.svg#svgFontName') format('svg'); /* Legacy iOS */
}

For reference: CSS Tricks - Using @font-face

like image 161
Germano Plebani Avatar answered Sep 20 '22 14:09

Germano Plebani