Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix "downloadable font: rejected by sanitizer"

Tags:

html

css

fonts

I want to use a font in my web page but i get these error messages in firefox when loading page:

downloadable font: rejected by sanitizer (font-family: "Yekan" style:normal weight:normal stretch:normal src index:1) source: .../css/Yekan.woff2  custom.css:1:12
downloadable font: incorrect file size in WOFF header (font-family: "Yekan" style:normal weight:normal stretch:normal src index:2) source: .../css/Yekan.woff  custom.css:1:12
downloadable font: rejected by sanitizer (font-family: "Yekan" style:normal weight:normal stretch:normal src index:2) source: .../css/Yekan.woff  custom.css:1:12
downloadable font: FFTM: invalid table offset (font-family: "Yekan" style:normal weight:normal stretch:normal src index:3) source: .../css/Yekan.ttf  custom.css:1:12
downloadable font: rejected by sanitizer (font-family: "Yekan" style:normal weight:normal stretch:normal src index:3) source: .../css/Yekan.ttf  custom.css:1:12
downloadable font: CFF : table overruns end of file (font-family: "Yekan" style:normal weight:normal stretch:normal src index:4) source: .../css/Yekan.otf  custom.css:1:12
downloadable font: rejected by sanitizer (font-family: "Yekan" style:normal weight:normal stretch:normal src index:4) source: .../css/Yekan.otf

my custom.css file:

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

my style.css (where i use the font):

body
{
   font-family: "Yekan";
}
  • I have searched a lot and found nothing to solve this.
  • I have used this font before and I had no problem.
  • I checked the meme type and it was correct (for example meme type of Yekan.ttf was application/x-font-ttf).
like image 931
Mohammad Avatar asked Sep 07 '19 16:09

Mohammad


1 Answers

I have found the problem, I used Filezilla to upload fonts to server and it was set on ASCII transfer mode, after switching to Binary and re-uploading fonts problem solved.

like image 175
Mohammad Avatar answered Nov 06 '22 22:11

Mohammad