Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何加载font-awesome等第三方图标库 #95

Open
pockry opened this issue May 28, 2014 · 0 comments
Open

如何加载font-awesome等第三方图标库 #95

pockry opened this issue May 28, 2014 · 0 comments

Comments

@pockry
Copy link

pockry commented May 28, 2014

我将css和fonts文件夹都放在app/assets下,然后通过package.js引入,则css中的fonts相对地址出错。
通过修改debug.html和index.html引入css的话,图标不能正常显示,firefox和chrome已测试。
但是,通过使用font-awesome的第三方cdn来引入css的话,图标能够正常显示。

目前怀疑是因为router没有设置fonts文件(.woff/.ttf),因此浏览器端无法正常识别这些文件。
firefox的控制台的错误信息如下:

downloadable font: incorrect file size in WOFF header (font-family: "Icons" style:normal weight:normal stretch:normal src index:2)
source: http://localhost:8080/assets/fonts/icons.woff semantic.min.css
downloadable font: rejected by sanitizer (font-family: "Icons" style:normal weight:normal stretch:normal src index:2)
source: http://localhost:8080/assets/fonts/icons.woff semantic.min.css

downloadable font: incorrect entrySelector for table directory (font-family: "Icons" style:normal weight:normal stretch:normal src index:3)
source: http://localhost:8080/assets/fonts/icons.ttf semantic.min.css
downloadable font: rejected by sanitizer (font-family: "Icons" style:normal weight:normal stretch:normal src index:3)
source: http://localhost:8080/assets/fonts/icons.ttf semantic.min.css
downloadable font: no supported format found (font-family: "Icons" style:normal weight:normal stretch:normal src index:4)
source: (end of source list)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant