简体   繁体   中英

Phonegap Windows phone 8 custom web-font

I'm trying to embed a custom font into a WebView in a Windows Phone 8 application and tried everything already. I came across a very promising article: blogs.msdn.com/b/wsdevsol/archive/2012/10/23/about-webview-and-embedded-fonts.aspx but it didn't work out.

Ex:

@font-face {
   font-family: 'Avenir LT W01 35 Light';
   src: url('35-light/avenirltstdlight.eot');
   src: url('35-light/avenirltstdlight.eot?#iefix') format('embedded-opentype'),
        url('35-light/avenirltstdlight.woff') format('woff'),
        url('35-light/avenirltstdlight.ttf') format('truetype'),
        url('35-light/avenirltstdlight.svg#avenirltstdlight') format('svg');
   font-weight: normal;
   font-style: normal;
}

Tried also including only the path with:

x-wapp0:avenir...woff

And even with Base64. What is funny is that opening the app in the browser, everything works fine. I only have problems when it gets embedded into Phonegap.

Can any of you help out or have any pointers about accomplishing this?

Again, on the very end I want to use a custom font (with web icons) into my HTML being shown in an app via Phonegap.

What is even more strange, is that even the embedded woff base64 font is not working.

Thank you

Try using TTFEdit to set the embeddable tag on the font to 0. That should fix it, but make sure you have the rights to embed the font before selling your app.

My full answer to a similar question might help too.

我遇到了同样的问题,这解决了我的问题: http : //code.tutsplus.com/articles/the-easiest-way-to-use-any-font-you-wish--net-3927

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM