0

I found this with html

In Firefox (Errors)

downloadable font: rejected by sanitizer (font-family: "Font Awesome 5 Free" style:normal weight:900 stretch:100 src index:1) source: http://localhost/project/public/webfonts/fa-solid-900.woff2

downloadable font: rejected by sanitizer (font-family: "Font Awesome 5 Free" style:normal  weight:900 stretch:100 src index:2) source: http://localhost/project/public/webfonts/fa-solid-900.woff

downloadable font: rejected by sanitizer (font-family: "Font Awesome 5 Free" style:normal weight:900 stretch:100 src index:3) source: http://localhost/project/public/webfonts/fa-solid-900.ttf

downloadable font: rejected by sanitizer (font-family: "Font Awesome 5 Free" style:normal weight:900 stretch:100 src index:1) source: http://localhost/project/public/webfonts/fa-solid-900.woff2

downloadable font: rejected by sanitizer (font-family: "Font Awesome 5 Free" style:normal weight:900 stretch:100 src index:2) source: http://localhost/project/public/webfonts/fa-solid-900.woff

downloadable font: rejected by sanitizer (font-family: "Font Awesome 5 Free" style:normal weight:900 stretch:100 src index:3) source: http://localhost/project/public/webfonts/fa-solid-900.ttf

In Chrome (warning)

Failed to decode downloaded font: http://localhost/project/public/webfonts/fa-solid-900.woff2

localhost/:1 Failed to decode downloaded font: http://localhost/project/public/webfonts/fa-solid-900.woff

localhost/:1 Failed to decode downloaded font: http://localhost/project/public/webfonts/fa-solid-900.ttf

in Firfox the icon is not displayed: <i class="fas fa-bars" ></i>, But it was shown in chrome

I tried to read answers to similar questions but, I did not understand

I used in my project:

fontawesome-free-5.14.0-web

   -> all.min.css file,
   -> webfonts folder

project
  |--public
       |-css
          -all.min.css
       |-js
       |-webfonts
       |-index.php

all.css / all.min.css (webfonts directory)

@font-face {
    font-family: 'Font Awesome 5 Brands';
    /* ...*/
    src: url("../webfonts/fa-brands-400.eot");
    src: url("../webfonts/fa-brands-400.eot?#iefix") format("embedded- opentype"), 

    url("../webfonts/fa-brands-400.woff2") format("woff2"),
    url("../webfonts/fa-brands-400.woff") format("woff"), 
    url("../webfonts/fa-brands-400.ttf") format("truetype"), 
    url("../webfonts/fa-brands-400.svg#fontawesome") format("svg"); }

   /* ...*/
 @font-face {
    font-family: 'Font Awesome 5 Free';
    /* ..*/
    src: url("../webfonts/fa-regular-400.eot");
    src: url("../webfonts/fa-regular-400.eot?#iefix") format("embedded-opentype"),
    url("../webfonts/fa-regular-400.woff2") format("woff2"),  
    url("../webfonts/fa-regular-400.woff") format("woff"),   
    url("../webfonts/fa- regular-400.ttf") format("truetype"),
    url("../webfonts/fa-regular-400.svg#fontawesome") format("svg"); }

/* ...*/ 
@font-face {
     font-family: 'Font Awesome 5 Free';
    /* ...*/ 
    src: url("../webfonts/fa-solid-900.eot");
    src: url("../webfonts/fa-solid-900.eot?#iefix") format("embedded-opentype"), 
    url("../webfonts/fa-solid-900.woff2") format("woff2"),
    url("../webfonts/fa-solid-900.woff") format("woff"),
    url("../webfonts/fa-solid-900.ttf") format("truetype"), 
    url("../webfonts/fa-solid-900.svg#fontawesome") format("svg"); }
Nacira
  • 56
  • 1
  • 8

2 Answers2

0

Check this out

You get this error if you run out of memory when loading the fontfile or if there is something wrong with the layout (contents) of the fontfile. This is a protection against bad or malicious font files. It is probably possible to disable the sanitizer by setting the pref gfx.downloadable_fonts.sanitize to false in about:config but then you are no longer protected. Use at your own risk. Do not blame Mozilla if you are infected with malware.

support.mozilla.org

Kingsley Uchenna
  • 580
  • 3
  • 15
0

Try using @import instead of @font-face.

I had these same errors loading Google fonts, and solved it with:

@import url('https://fonts.googleapis.com/css2?family=Jost&display=swap');
Michael L
  • 11
  • 4