A Visual Studio solution which shows how to use @font-face in Windows Phone 8 WebBrowser control with fonts embedded in the XAP.
You can check out the commits on this repo to quickly see the required changes applied on top of Visual Studio's default Windows Phone 8 HTML5 App project template.
- WebBrowser only works with TrueType fonts (other formats can be included but will make no difference).
- The font's file Build Action must be set to Content:
- Don't use a query string in the @font-face declaration:
- Make sure the font's file "embeddable flag" is set to 0.
- You can use TTFEdit to change the flag:
- View
- Show advanced
- OS/2
- Legal rights for embedding
- But only if you own the font: http://en.wikipedia.org/wiki/TrueType#Embedding_protection
- You can use TTFEdit to change the flag:
- Only works on Windows Phone 8 with Update 2 (GDR2) or superior.
- You can download the emulators running the updates from here to try it out.
- This sample was tested both on emulators and on actual devices running Windows Phone 8 without updates, with GDR1, with GDR2, and with GDR3, and Windows Phone 8.1 Preview.
- Working (GDR2, GDR3, and 8.1 Preview):
- Not working (Windows Phone 8 without updates or just GDR1):
Credit goes entirely to Thomas Forth, I just created this repo to make his solution easily available to everyone.
This sample uses Font Awesome.