8

if I using what is everywhere recommended - using CDN attachment for "Font Awesome" everytime flickering "on page load".

<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css" rel="stylesheet" />

Q how prevent flickering?

Bruno
  • 6,623
  • 5
  • 41
  • 47

4 Answers4

2

In my solution I download font resources to server

But even than still happened - Chrome and Firefox too.

For that is there font type "woff2". I add new webserver handler:

for #iis add

C:\Program Files\IIS Express\AppServer\applicationhost.config
<mimeMap fileExtension=".woff2" mimeType="font/woff2" />

and for #nginx add (see how Mime type for WOFF fonts?)

/etc/nginx/mime.types || or /usr/local/nginx/conf/mime.types
font/woff2 woff2;

Mime types by Mozilla.

Now font icons are loaded fast like images.

I hope this helps someone.

Bruno
  • 6,623
  • 5
  • 41
  • 47
2

My solution was to add @font-face directly in the <head> tag:

<!DOCTYPE html>
<html lang="en">
  <head>
    <style name="FontAwesome">
        @font-face {
          font-family: 'FontAwesome';
          src: url('https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/fonts/fontawesome-webfont.eot');
          src: url('https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/fonts/fontawesome-webfont.eot?#iefix') format('embedded-opentype'),
               url('https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/fonts/fontawesome-webfont.woff2') format('woff2'),
               url('https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/fonts/fontawesome-webfont.woff') format('woff'),
               url('https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/fonts/fontawesome-webfont.ttf') format('truetype'),
               url('https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/fonts/fontawesome-webfont.svg?#fontawesomeregular') format('svg');
          font-weight: normal;
          font-style: normal;
        }
    </style>

    <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css}" rel="stylesheet">

This what Google do in Youtube and other websites

ahmed
  • 5,430
  • 1
  • 20
  • 36
2

I had the same issue and it appeared that I have included the FontAwesome stylesheet twice and after removing one of them the problem was gone.

0

I switched from using Web Font to SVG. Cured the problem.