簡體   English   中英

Sencha Architect ExtJs中的Icomoon字形應用程序不起作用

[英]Icomoon Glyphs in Sencha Architect ExtJs Application not working

我在extjs 5應用程序中使用Sencha Architect 3.0(非觸摸)。 我需要使用icomoon字體來實現字形。 我正在執行以下步驟。

我已經在其demo.html頁面中使用了圖標集及其樣式。

我已經在資源位置下的css文件夾中復制了fonts文件夾和相關樣式,也使用Sencha Architect添加了css。

在style.css中也找到正確的字體位置。 例如

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

在樣式CSS中,我有以下類別,例如:

[class^="icon-"], [class*=" icon-"] {
font-family: 'icomoon';
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;

/* Better Font Rendering =========== */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

.icon-2008:before {
    content: "\e600";
}

在Ext按鈕中,我已將iconCls屬性設置為“ icon-2008”,並將字形設置為e600。

它向我顯示了按鈕上的字形,但按鈕的背景中帶有&#e600。

在Sencha CMD中:sencha應用刷新就可以了。

請提出我做錯了什么,或者應該采取什么步驟?

謝謝

  1. 將與icomoon相關的CSS包含在app.json或index.html中

  2. 在您的app.js或application.js中包括這一行Ext.setGlyphFontFamily('icomoon');

  3. 在按鈕cfg中,無需提及iconCls即可獲取字形。 您可以改為僅應用字形cfg。

glyph:0xe600-(非字符串值)

要么

字形:'600 @ icomoon'-(字符串值)

我終於做到了這一點,我遵循的所有步驟都是正確的,只有我做錯的是設置字形代碼:

我曾經將字形代碼設置為e600 @ icomoon,正確的表示應為

glyph: xe600@icomoon

然后它應該工作!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM