久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

FontAwesome 無法在本地和電子應用程序中加載字體

FontAwesome fails to load fonts locally and in electron app(FontAwesome 無法在本地和電子應用程序中加載字體)
本文介紹了FontAwesome 無法在本地和電子應用程序中加載字體的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我已經使用 npm 下載了 FontAwesome,然后使用 grunts 復制任務將 css 文件和字體復制到我的電子應用程序根目錄中的正確文件夾中.

I have downloaded FontAwesome using npm and then copied the css-file and the fonts into the right folders in the root-diretory of my electron-application using grunts copy task.

到目前為止一切順利.一切都在它應該在的地方.

So far so good. Everything is where it is supposed to be.

現在,當我在我的應用程序中引用 FontAwesome 時,圖標不會被加載.這些是我在控制臺中遇到的錯誤:

Now, when i am referencing FontAwesome in my app, the icons do not get loaded. These are the errors that I get in the console:

解碼下載的字體失敗:
file:///path/to/fonts/fontawesome-webfont.woff2?v=4.4.0
OTS 解析錯誤:無法將 WOFF 2.0 字體轉換為 SFNT

Failed to decode downloaded font:
file:///path/to/fonts/fontawesome-webfont.woff2?v=4.4.0
OTS parsing error: Failed to convert WOFF 2.0 font to SFNT

解碼下載的字體失敗:
file:////path/to/fonts/fontawesome-webfont.woff?v=4.4.0
OTS 解析錯誤:WOFF 標頭中的文件大小不正確

Failed to decode downloaded font:
file:////path/to/fonts/fontawesome-webfont.woff?v=4.4.0
OTS parsing error: incorrect file size in WOFF header

解碼下載的字體失敗:
file:////path/to/fonts/fontawesome-webfont.ttf?v=4.4.0
OTS解析錯誤:表目錄的entrySelector不正確

Failed to decode downloaded font:
file:////path/to/fonts/fontawesome-webfont.ttf?v=4.4.0
OTS parsing error: incorrect entrySelector for table directory

我已經嘗試通過刪除所有版本參數來修改 FontAwesome 的 css 文件,但這似乎不是問題.通過 electron . 啟動應用程序以及在瀏覽器中查看 html 文件時都會出現問題.

I have already tried to modify FontAwesome's css file by removing all the version parameters but this does not seem to be the problem. The Issues comes up both by starting the app via electron . and when viewing the html-file in the browser.

更新

回答一些評論:

  • 此問題出現在電子和瀏覽器中(在 chrome 和 firefox 中測試)
  • 我使用的是最新版本的 FontAwesome (4.4.0) 和 Electron (0.32.1)(通過 npm 全新安裝)
  • css 的加載方式如下:

推薦答案

問題出在我的 grunt 文件中.我試圖通過簡單地在他們的供應商網站上手動下載所有依賴項并將它們放在我項目的相應腳本文件夾中來重現該問題 - 突然它起作用了.

The Problem was in my grunt-file. I tried to reproduce the issue by simply downloading all dependencies manually at their vendors websites and placed them in the corresponding script-folder of my project - suddenly it worked.

我現在切換到 gulp,它仍然有效.不知道我在 grunt 上做錯了什么......

I switched to gulp now and it still works. No idea what i was doing wrong with grunt though...

這篇關于FontAwesome 無法在本地和電子應用程序中加載字體的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

discord.js v12: How do I await for messages in a DM channel?(discord.js v12:我如何等待 DM 頻道中的消息?)
how to make my bot mention the person who gave that bot command(如何讓我的機器人提及發出該機器人命令的人)
How to fix Must use import to load ES Module discord.js(如何修復必須使用導入來加載 ES 模塊 discord.js)
How to list all members from a specific server?(如何列出來自特定服務器的所有成員?)
Discord bot: Fix ‘FFMPEG not found’(Discord bot:修復“找不到 FFMPEG)
Welcome message when joining discord Server using discord.js(使用 discord.js 加入 discord 服務器時的歡迎消息)
主站蜘蛛池模板: 中文字幕在线一区 | 亚洲欧美日韩精品久久亚洲区 | 精品美女在线观看视频在线观看 | 超碰激情 | 欧美日韩在线综合 | 亚洲国产精品久久久 | 精品中文字幕在线 | 日韩免费网站 | 中文字幕免费中文 | 久久精品久久久 | 欧美在线视频二区 | 精品网站999| 亚洲成人99 | 在线一区 | 中文字幕第十一页 | 天天天操天天天干 | 亚洲国产成人在线视频 | 夜夜草天天草 | 最新中文字幕 | 超碰成人免费观看 | 日日久| 日本黄色免费视频 | 国产精品无 | 亚洲午夜精品一区二区三区他趣 | 欧美一区二区久久 | 超碰成人在线观看 | 国产精品久久久久久久久久久久久 | 亚洲天堂中文字幕 | 天天草天天爱 | 免费观看色 | 国产精品69毛片高清亚洲 | 成人久久久 | 天堂一区二区三区 | 国产不卡在线播放 | 一级国产精品一级国产精品片 | 国产视频三区 | 久久夜夜 | 欧美中文字幕一区二区三区 | 国产黑丝av | 成人欧美日韩一区二区三区 | 激情小视频 |