我下載了名爲「Clunk」的TTF字體,我試圖將它應用於某些文本。爲什麼TTF字體不能在我的瀏覽器中工作?
下面是我使用的代碼:
<html>
<head>
<style>
@font-face {
font-family: clunk;
src: url('clunk.ttf');
}
h1 {
font-family: clunk;
}
</style>
</head>
<body>
<h1 id="logo">Test</h1>
</body>
</html>
這似乎並不工作和Chrome是給我兩個錯誤:
Failed to decode downloaded font: (path to the file)
OTS parsing error: incorrect entrySelector for table directory
在Firefox中,這是出現錯誤:
downloadable font: bad search range (font-family: "clunk" style:normal weight:normal stretch:normal src index:0) source: (path to the file) test.html:4:12
downloadable font: incorrect entrySelector for table directory (font-family: "clunk" style:normal weight:normal stretch:normal src index:0) source: (path to the file) test.html:4:12
downloadable font: rejected by sanitizer (font-family: "clunk" style:normal weight:normal stretch:normal src index:0) source: (path to the file)
我搜索了這些錯誤,但這個問題似乎很廣泛,很難找到迷你惡意的例子。在這種簡單的情況下會造成什麼錯誤?
你使用的是git嗎? –