FontAwesome fails to load fonts locally and in electron app

前端 未结 8 1425
野的像风
野的像风 2020-12-14 15:09

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 t

相关标签:
8条回答
  • 2020-12-14 15:30

    If you are using the bower you could rewrite your font-face to:

    @font-face {
      font-family: FontAwesome;
      src: url(font-awesome/fonts/fontawesome-webfont.eot);
      src: url(font-awesome/fonts/fontawesome-webfont.eot?#iefix) format('embedded-opentype'), 
           url(font-awesome/fonts/fontawesome-webfont.woff) format('woff'), 
           url(font-awesome/fonts/fontawesome-webfont.ttf) format('truetype'), 
           url(font-awesome/fonts/fontawesome-webfont.svg#fontawesomeregular) format('svg');
      font-weight: 400;
      font-style: normal
    }
    
    0 讨论(0)
  • 2020-12-14 15:31

    I'm sure this is solved, but this worked for me, so... I'm gonna leave this here:

    I just had the same issue with a font I had used before. Turned out this was caused by a problem with FTP. The file was uploaded as text (ASCII) instead of binary, which corrupted the file. I simply re-uploaded the font files, and then it all worked.

    0 讨论(0)
提交回复
热议问题