Custom font on Dawn theme give me sanitizer error

Custom font on Dawn theme give me sanitizer error

DeLeo
Visitor
2 0 1

I'm trying to use custom font on my website I added the woff and woof2 files in my assets and inserted the following code inside the theme.liquid file:

 

 

 

<style>
  @font-face {
  font-family: "neutra_textbook";
  src: url('{{ "neutratextbook.woff2" | asset_url }}') format("woff2"),
       url('{{ "neutratextbook.woff" | asset_url }}') format("woff");
  font-weight: normal;
  font-style: normal;
}
</style>

 

 

 

but it give me this error:
downloadable font: rejected by sanitizer

Replies 2 (2)

Abdosamer
Shopify Partner
895 163 181

Hi @DeLeo , Did you try to download the font from other source, maybe the font files are corrupted.

Buy me a Coffee
Email : abdelrahamansamer71@gmail.com
Chat on WhatsApp
My work
DeLeo
Visitor
2 0 1

I fixed it by loading the same font files inside the shopify "files" section and now it works, still not understanding why it don't works if fonts are loaded insde assets