css - Web font hosted on another domain -
i know if it's possible host webfonts on domain, css hosted on amazon cloudfront , webfonts don't show up, fine when css in local.
this style.css on cloudfront:
@font-face { font-family: 'aller'; src: url('/app/files/fonts/allerdisplay-webfont.eot'); src: local('☺'), url('/app/files/fonts/allerdisplay-webfont.woff') format('woff'), url('/app/files/fonts/allerdisplay-webfont.ttf') format('truetype'), url('/app/files/fonts/allerdisplay-webfont.svg#webfontlz8nc4vc') format('svg'); font-weight: 900; font-style: normal; }
the stylesheet hosted on cloudfront using subdomain: static.mydomain.com/style.css , webfont can downloaded : static.mydomain.com/app/files/fonts/allerdisplay-webfont.ttf
unfortunately when stylesheet called mydomain.com doesn't load it. wondering if it's limitation or that.
thanks
should no problem absolute path url in style declaration.
in code above, have relative path urls.
need absolute path url, like:
"http://static.mydomain.com/app/files/fonts/allerdisplay-webfont.ttf" (absolute)
-- not --
"/app/files/fonts/allerdisplay-webfont.ttf" (relative)
theoretically, depending on architecture of subdomain, might able rig way maintain relative url, not worth trouble. use absolute 1 , done it.
[previous suggestions below posted before relevant code posted] google web fonts achieves moving entire style sheet cloud. if can't running inside style sheet, might try creating separate style sheet instead.
note, however, true cross-browser compatibility, need bunch of different font file formats... problem. fontsquirrel has font kit generator may want check out that.
Comments
Post a Comment