I'm building a Windows Phone 8 HTML5 app that shows an external website on the web. When the page loads, it shows all the content along with the correct css styling except for the web font. The web font is not included in the project, it is run from the website online. Also, I know javascript is running because other javascripts are working on the page. Does anyone know a solution to get web fonts working inside apps? If it helps, when I direct the main web browser in Windows Phone 8 to the webpage in question, the webfonts load fine.
Custom fonts can be used in Windows Phone 8 HTML5 apps in the same way as they are used on websites and other mobile platforms' webviews. There are two things to watch out for,
Properties>Advanced>Build Action
is set to "Content" so it is copied to the device when the project is built and deployed.You can inspect the embeddable flag of any truetype font using the open-source TTFEdit. You can make a font embeddable by changing the value in View>Show>Advanced>Legal rights for embedding
to 0 and re-saving it. Only change the flag if the font is licensed for embedding.
I've tested with a number of truetype fonts with no problem. My only issue so far has been when including the font-awesome library where the src:
values in font-awesome.min.css
needed changing to fix a bug in IE10 mobile. When using font-awesome,
src:url('../fonts/fontawesome-webfont.ttf?v=4.0.3')
won't work. src:url('../fonts/fontawesome-webfont.ttf')
will.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With