简体   繁体   English

Phonegap Windows Phone 8自定义Web字体

[英]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. 我试图将自定义字体嵌入Windows Phone 8应用程序中的WebView中,并且已经尝试了所有方法。 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. 我遇到了一篇非常有前途的文章: blogs.msdn.com/b/wsdevsol/archive/2012/10/23/about-webview-and-embedded-fonts.aspx,但没有成功。

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. 甚至使用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. 当它嵌入到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. 同样,最后,我想通过Phonegap在应用程序中显示HTML中的自定义字体(带有Web图标)。

What is even more strange, is that even the embedded woff base64 font is not working. 更奇怪的是,即使嵌入式woff base64字体也不起作用。

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. 尝试使用TTFEdit将字体上的embeddable标签设置为0。这应该可以解决,但是在出售应用之前,请确保您具有嵌入字体的权限。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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