Using @ font-face with Tumblr

I would like to use a custom font purchased from a foundry type on my Tumblr. The method used by the foundry is @ font-face. I uploaded the files (.eot, .svg, .ttf and .woff) to my server, linked the stylesheet and added the necessary attributes to my css. I have included a hotlink to my Tumblr address from my server. But that didn't work either. Another user here suggested uploading files to Tumblr directly, but I kept getting this error in the console:

(index): 1 Font from source ' http://static.tumblr.com ' was blocked from downloading by Cross-Origin resource sharing policy: No 'The Access-Control-Allow-Origin header is present on the requested resource. The origin of http://mysite.tumblr.com 'is therefore not allowed.

I am not sure how to change Cross Origin settings on my server, and this is not my personal one, so I cannot make such changes.

Anyone with experience using custom fonts in Tumblr can share their best practice tips.

Thank.

+4
source share
1 answer

Use the rel link to add a stylesheet.

, .htaccess, .

.htaccess:

      <FilesMatch "\.(ttf|ttc|otf|eot|woff|svg)$">
      <IfModule mod_headers.c>
          Header set Access-Control-Allow-Origin "*"
      </IfModule>
  </FilesMatch>
AddType application/vnd.ms-fontobject .eot
  AddType application/octet-stream .otf .ttf

: http://blog.jiffle.net/post/31490944631/font-face-with-tumblr

tumblr .

0

Source: https://habr.com/ru/post/1570359/


All Articles