issue with @font-face on mozilla while using Shopify

最后都变了- 提交于 2019-12-12 03:35:31

问题


I am using the css

 @font-face {
 font-family: ChangaOne-Regular;
 src: url({{ 'changaone-regular.eot' | asset_url }});
 src: url({{ 'changaone-regular.eot?#iefix' | asset_url }}) format('embedded-opentype'),  url({{ 'changaone-regular.woff' | asset_url }}) format('woff'),  url({{ 'changaone-regular.ttf' | asset_url }}) format('truetype'),  url({{'changaone-regular.svg#changaone-regular' | asset_url }}) format('svg');
 font-weight: normal;
 font-style: normal;
}

I have saved the font in images folder. Since it was not taking the font I created the copy of the font in the folder within my css file.

Now it is working perfectly on chrome. But in mozilla the font is not getting read. I found that we can fix this by adding htaccess to the folder of the css file with content

<FilesMatch "\.(ttf|otf|eot|woff|font.css)$">
  <IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
  </IfModule>
</FilesMatch>

This is also not making any difference in firefox. So how can we fix this? any idea?


回答1:


Try using an absolute URL to the font file.



来源:https://stackoverflow.com/questions/14519613/issue-with-font-face-on-mozilla-while-using-shopify

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!