3
我剛剛生成使用http://fontello.com/上鬼安裝引用@fontface
當我嘗試引用它放在我的鬼安裝的文件總是返回404.這一個個性化字體 - 真棒是我所做的:
我添加的文件夾/內容/主題/ [主題名稱] /資產/字體
我引用來自default.hbs
主要.css文件生成的字體文件的整個文件夾
像這樣:
<link rel="stylesheet" type="text/css" href="{{asset "fonts/custom_webfont.css"}}">
此.css文件有一個指令,可以讓不同的瀏覽器選擇正在投放的字體支持的文件類型:
@font-face {
font-family: 'custom_webfont';
src: url('custom_webfont.eot');
src: url('custom_webfont.eot#iefix') format('embedded-opentype'),
url('custom_webfont.woff') format('woff'),
url('custom_webfont.ttf') format('truetype'),
url('custom_webfont.svg#custom_webfont') format('svg');
font-weight: normal;
font-style: normal;
}
當任一頁面我鬼裝置得到呈現它正確地服務於這個地址上的CSS:
/assets/fonts/custom_webfont.css?v=594627dbc0
(我假設附加的v數用於緩存目的)
但是沒有提供字體文件。如果我嘗試這些URL中的任何一個都沒有發現:
http://localhost:2368/assets/fonts/custom_webfont.woff/?v=594627dbc0
http://localhost:2368/assets/fonts/custom_webfont.woff
http://localhost:2368/assets/fonts/custom_webfont.eof/?v=594627dbc0
http://localhost:2368/assets/fonts/custom_webfont.eof