Remove the ?v=4.6.3
and remaining tail from this block (font-awesome.css
/ font-awesome.min.css
).
@font-face {
font-family: 'FontAwesome';
src: url('../fonts/fontawesome-webfont.eot?v=4.6.3');
src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.6.3') format('embedded-opentype'),
url('../fonts/fontawesome-webfont.woff2?v=4.6.3') format('woff2'),
url('../fonts/fontawesome-webfont.woff?v=4.6.3') format('woff'),
url('../fonts/fontawesome-webfont.ttf?v=4.6.3') format('truetype'),
url('../fonts/fontawesome-webfont.svg?v=4.6.3#fontawesomeregular') format('svg');
font-weight: normal;
Updated to:
@font-face {
font-family: 'FontAwesome';
src: url('../fonts/fontawesome-webfont.eot');
src: url('../fonts/fontawesome-webfont.eot') format('embedded-opentype'),
url('../fonts/fontawesome-webfont.woff2') format('woff2'),
url('../fonts/fontawesome-webfont.woff') format('woff'),
url('../fonts/fontawesome-webfont.ttf') format('truetype'),
url('../fonts/fontawesome-webfont.svg') format('svg');
font-weight: normal;
font-style: normal;
}
Подскажите пожалуйста в чём может быть дело. Во всех браузерах отображается всё нормально без ошибки, в FireFox же, шрифт не применяется и в отладчике ошибки:
downloadable font: cmap: unexpected range shift (3 != 4) (font-family: «AGHelveticaCyr» style:normal weight:normal stretch:normal src index:0) source: file:///C:/Users/SkyWay/Desktop/%D1%81%D0%B0%D0%B9%D1%82-ver1%20-%20%D0%BA%D0%BE%D0%BF%D0%B8%D1%8F/%D1%81%D0%B0%D0%B9%D1%82/fonts/AGHelveticaCyr.ttf style.css
downloadable font: cmap: failed to parse table (font-family: «AGHelveticaCyr» style:normal weight:normal stretch:normal src index:0) source: file:///C:/Users/SkyWay/Desktop/%D1%81%D0%B0%D0%B9%D1%82-ver1%20-%20%D0%BA%D0%BE%D0%BF%D0%B8%D1%8F/%D1%81%D0%B0%D0%B9%D1%82/fonts/AGHelveticaCyr.ttf style.css
downloadable font: rejected by sanitizer (font-family: «AGHelveticaCyr» style:normal weight:normal stretch:normal src index:0) source: file:///C:/Users/SkyWay/Desktop/%D1%81%D0%B0%D0%B9%D1%82-ver1%20-%20%D0%BA%D0%BE%D0%BF%D0%B8%D1%8F/%D1%81%D0%B0%D0%B9%D1%82/fonts/AGHelveticaCyr.ttf
вот мой код загрузки и использования шрифта jsfiddle.net/dudkj7sf
Версия Firefox 32.0.3. Да и два других шрифта, загруженных таким же образом, никаких ошибок не выдают
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).
asked Sep 7, 2019 at 16:29
5
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.
answered Sep 7, 2019 at 18:31
MohammadMohammad
2211 gold badge2 silver badges8 bronze badges
I recently had this problem with the icon font of the npm package bootstrap-icons
version 1.5.0 on the server. I’m using the icons classes and wrapping them with own class names in SCSS.
The solution for me was to redefine the bootstrap font-family and copy and rename the font files to the project. So it looks in styles.scss
like this:
@font-face {
font-family: "bootstrap-icons-redef";
src: url("../assets/fonts/bootstrap-icons-redef.woff2") format("woff2"),
url("../assets/fonts/bootstrap-icons-redef.woff") format("woff");
}
A small disadvantage of this solution is that I have to check node_modules/bootstrap-icons/font/bootstrap-icons.css
on every update to be sure my redefinition is still in sync with the file above.
answered Sep 22, 2021 at 12:54
Juri SinitsonJuri Sinitson
1,3951 gold badge12 silver badges18 bronze badges
I ran into an issue today when I tried to serve a typeface I downloaded from Google Fonts. When I added the files and @font-face
rules to my CSS, I got the following error in the Firefox console:
downloadable font: rejected by sanitizer
(font-family: "Inter" style:normal weight:400 stretch:100 src index:0)
source: http://localhost:8080/fonts/Inter-Regular.ttf
The Chrome console had nothing, so I figured this was a Firefox issue. After some searching around, I learned that Firefox is checking that a font file is valid before loading it, which can protect you against some attacks.
Inter is a pretty popular typeface, so I ruled out corrupt or malicious font files. Further digging lead me to some solutions, but they seemed situation specific.
I was prepared to live with the error, when I gave it one last look. The source url (which I’ve wrapped here but was broken on two lines in the console) was incorrect. The path to the font files should have been assets/fonts/Inter-Regular.ttf
. Fixing that path in @font-face
’s src
resolved the issue.
If you encounter a similar error, check to make sure that the path to your font file is correct. It would be helpful if the message was more descriptive: “downloadable font: rejected by sanitizer (file not found)“.
Happy font serving!
— anyone have a problem with this? I can’t get the CSS attribute font-face to work for downloadable fonts.
@font-face
{
font-family: minecraft; src: url("../files/minecraft.ttf");
}
What is the sanitizer and how can I configure it to accept the downloaded font?
— anyone have a problem with this? I can’t get the CSS attribute font-face to work for downloadable fonts.
@font-face
{
font-family: minecraft;
src: url(«../files/minecraft.ttf»);
}
What is the sanitizer and how can I configure it to accept the downloaded font?
Chosen solution
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.
Read this answer in context
👍 5
All Replies (3)
Chosen Solution
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.
Thanks cor-el; I will give this a try, so far it’s looking good — still gotta plug it in to my CSS to see if it will work.
This is for my college class so thanks for the speedy reply — I lost power over the last week with Ice storms and trees falling all around me — so please forgive the lateness of the reply.
Regards,
Saghalie
Halo Wawa, Boire du Cafe’
Modified January 21, 2012 at 1:11:13 PM PDT by Saghalie