2016-03-04 56 views
-1

我有我自己的圖標字體,所以我有10個圖標。主要問題如下。 8的他們的網站上顯示良好,但其中2顯示像我給他們的信(「F」和「E」)圖標字體不顯示一些圖標

例如,這是我如何插入我的圖標

。 test-icon-user1:before {content:「\ 61」;}
.test-icon-user2:before {content:「\ 62」;}
.test-icon-user3:before {content:「\ 「;」
.test-icon-user4:before {content:「\ 64」;}
.test-icon-user5:before {content:「\ 65」;}
.test-icon-user6 :before {content:「\ 66」;}
.test-icon-user7:before {content:「\ 67」;}

其中只有2個不起作用...這很奇怪,因爲我插入它們的方式是一樣的,樣式表加載好,一切都很好。

enter image description here

這是怎麼樣子。

這是我如何通過HTML插入(名字是不完全一樣的原始,所以我必須檢查所有更多鈔票拼寫錯誤)

<a id="sticky-login-toggle" class="test-icon-user1 sticky-toggle"></a> 

最後我如何插入圖標字體

@font-face { 
    font-family: "test"; 
    src:url("fonts/test.eot"); 
    src:url("fonts/test.eot?#iefix") format("embedded-opentype"), 
    url("fonts/test.woff") format("woff"), 
    url("fonts/test.ttf") format("truetype"), 
    url("fonts/test.svg#test") format("svg"); 
    font-weight: normal; 
    font-style: normal; 

} 

[class^="icon-"]:before, 
[class*=" test-icon-"]:before { 
    font-family: "test" !important; 
    font-style: normal !important; 
    font-weight: normal !important; 
    font-variant: normal !important; 
    text-transform: none !important; 
    speak: none; 
    line-height: 1; 
    -webkit-font-smoothing: antialiased; 
    -moz-osx-font-smoothing: grayscale; 
} 
+0

爲什麼您的圖標字體沒有設置PUA中的字形,並且GSUB規則將該圖標的名稱替換爲該PUA代碼點?現在你的圖標字體假裝成拉丁字體,而絕對不是一個。 –

+0

對不起,但我沒有承諾。請問你能否解釋一下,也許這可能是解決方案 –

+0

字體有兩組字形:真正的字形,真實的語言,然後是「這些形狀與實際語言或unicode等無關」的專用區。所以如果你製作了一個適當的圖標字體,你要確保字體將所有這些圖標存儲爲私有使用區域形狀,然後添加GSUB替換規則,在那裏你告訴字體「如果你被要求塑造單詞」笑臉「而是在PUA spot 12「中呈現圖標或其他東西。你做了什麼你的字體? –

回答

1

這是答案。

FontAwesome icons not showing. Why?

和codepen仍然actvia。你可以有粘貼代碼,看到正在

http://codepen.io/TheNathanG/pen/xbyFg

我有我自己的圖標字體,所以我必須在這10個圖標。主要問題如下。其中8個在網站上顯示效果也很好,但其中2顯示像我給他們的信(「F」和「E」)

例如,這是我如何插入我的圖標

.test-icon-user1:before {content: "\61";} 
.test-icon-user2:before {content: "\62";} 
.test-icon-user3:before {content: "\63";} 
.test-icon-user4:before {content: "\64";} 
.test-icon-user5:before {content: "\65";} 
.test-icon-user6:before {content: "\66";} 
.test-icon-user7:before {content: "\67";} 
0

我遇到了同樣的問題。我使用fontastic創建自定義圖標字體,並將文件推送到實時測試服務器時 - 圖標顯示爲字符映射字母。我終於明白這是一個文件許可問題。

一定要檢查您的網站(或測試網站)上的字體文件夾和css文件的文件權限 - 我必須調整字體文件夾,css文件和字體文件的權限 - 否則我得到在我的控制檯嘗試訪問字體文件時出現禁止的錯誤,它只會顯示一個字母。