Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FontAwesome displaying as squares on WP8 using cordova/phonegap

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

like image 923
Gillardo Avatar asked Aug 15 '14 15:08

Gillardo


People also ask

What is Fontawesome Webfont?

Font Awesome is the Internet's icon library and toolkit, used by millions of designers, developers, and content creators.

Is Fontawesome a CSS?

Font Awesome gives you scalable vector icons that can instantly be customized — size, color, drop shadow, and anything that can be done with the power of CSS.

Why is Fontawesome used?

Font Awesome is designed to be used with inline elements. The <i> and <span> elements are widely used for icons. Also note that if you change the font-size or color of the icon's container, the icon changes. Same things goes for shadow, and anything else that gets inherited using CSS.


1 Answers

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

like image 117
Gillardo Avatar answered Sep 29 '22 12:09

Gillardo