Web Analytics

Fill the form & Get Installation Support

How to solve font error like ‘downloadable font: rejected by sanitizer’ in Magento 2?

If you have faced below font related error in browser console,

downloadable font: rejected by sanitizer (font-family: “Sofia Pro Regular” style:normal weight:400 stretch:100 src index:0) source: ../../../../../../en_US/fonts/SofiaProRegular.woff2 in magento 2

Then follow given step-by-step guide to solve the error.

Step 1: First check used fonts related ttf, woff and woff2 files. It must be available in the font folder with the same name.

E.g.

 

Step 2 : Open below file

app/design/frontend/Magemonkey/YourTheme/web/css/source/_typography.less

Step 3 : Add below mention line under font path in _typoraphy.less

E.g. @font-format: ‘woff’,

See below code after adding above mention line and it should look like below

 

Step 4: After placing the above code, please run the below-mentioned commands

That’s it…

Now refresh your site and check the console for this font-related error. Your font error should be solved.

Fill the below form if you have any Magento programming need.





    Recent Articles

    Author Info

    Hire R. Patel

    Get a Free Quote





      /* second popup */

      Connect With Us