FontAwesome displaying as squares on WP8 using cordova/phonegap

北慕城南 提交于 2019-12-05 00:16:51

问题


I am using the AngularMobileUI framework and the icons just display as squares. I have previously tried the Ionic framework and that did the same.

Anyone know how to fix this, and also why it happens?

My icons display fine on android and ios


回答1:


Encase someone has this problem, i found part of the answer here

Getting a web-font to work on an HTML5 Windows Phone App?

FontAwesome has the embeddable flag set to 4. First you need to set the value to zero. Once that is done, you need to change the css and remove the querystring when loading the font file.

@font-face {
  font-family: 'FontAwesome';
  src: url('../fonts/fontawesome-webfont.eot?v=4.1.0');
  src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.1.0') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff?v=4.1.0') format('woff'), url('../fonts/fontawesome-webfont.ttf?v=4.1.0') format('truetype'), url('../fonts/fontawesome-webfont.svg?v=4.1.0#fontawesomeregular') format('svg');
  font-weight: normal;
  font-style: normal;
}

becomes

@font-face {
  font-family: 'FontAwesome';
  src: url('../fonts/fontawesome-webfont.eot?v=4.1.0');
  src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.1.0') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff?v=4.1.0') format('woff'), url('../fonts/fontawesome-webfont.ttf') format('truetype'), url('../fonts/fontawesome-webfont.svg?v=4.1.0#fontawesomeregular') format('svg');
  font-weight: normal;
  font-style: normal;
}

I just removed the querystring from the ttf file, since on android and ios, this seems to not matter.

Hope this help someone



来源:https://stackoverflow.com/questions/25329784/fontawesome-displaying-as-squares-on-wp8-using-cordova-phonegap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!