久久久久久久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 服務器時的歡迎消息)
主站蜘蛛池模板: 国产精品一区二区久久 | 国产精品欧美一区二区三区 | 中国一级大毛片 | 看av网址| 91中文字幕在线观看 | 亚洲国产中文在线 | 综合久久综合久久 | 中日韩毛片 | 欧美高清视频在线观看 | 欧美一级做a爰片免费视频 国产美女特级嫩嫩嫩bbb片 | 国产91丝袜在线播放 | 99re在线视频 | 亚洲av毛片 | 黄色大片视频 | 精品国模一区二区三区欧美 | 欧美精品二区三区 | 色狠狠一区 | 欧美激情在线精品一区二区三区 | 天堂一区二区三区四区 | 91免费在线视频 | 91素人 | 国产免费观看视频 | 精品一区二区三区入口 | 亚洲一区中文字幕 | 亚洲视频在线看 | 成人免费观看男女羞羞视频 | 超碰精品在线 | caoporn视频| 亚洲91精品 | 色欧美片视频在线观看 | 日韩成人一区 | 懂色av一区二区三区在线播放 | 午夜成人在线视频 | 日日摸夜夜添夜夜添特色大片 | 91精品一区 | 成人精品免费视频 | 欧美精品在线一区 | 亚洲影视在线 | 最新av在线播放 | 天天操欧美| 不卡欧美 |