简体   繁体   English

Windows Phone 8的Phonegap / Cordova网络字体

[英]Phonegap/Cordova web-fonts with Windows Phone 8

(Possibly a duplicate with Webfont in Windows Phone 8 HTML5 App ... however, particularly Phonegap in question) (可能是Windows Phone 8 HTML5应用程序中Webfont的副本...但是,尤其是有问题的Phonegap)

I am trying to use a custom web font in my app. 我正在尝试在我的应用程序中使用自定义Web字体。 It fails to load the font. 无法加载字体。 (Cordova 2.3.0 & Windows Phone 8). (Cordova 2.3.0和Windows Phone 8)。

It appears like the css @font-face block is not loaded at all. 似乎css @ font-face块根本没有加载。 No luck regardless which font format. 不管哪种字体格式都没有运气。 Fonts added as 'content' in Build Action. 在“生成操作”中作为“内容”添加的字体。

@font-face {
font-family: "SSPika";
src: url('ss-pika.eot');
src: url('ss-pika.eot?#iefix') format('embedded-opentype'),
   url('ss-pika.woff') format('woff'),
   url('ss-pika.ttf')  format('truetype'),
   url('ss-pika.svg#SSPika') format('svg');
font-weight: normal;
font-style: normal;
} 

And similar to the other question, loading the same content remotely (in iframe) renders perfectly. 与另一个问题类似,远程(在iframe中)加载相同的内容可以完美呈现。

Any ideas? 有任何想法吗?

I have searched and found the following post. 我已经搜索并找到以下帖子。 May be it is related. 可能是相关的。

Phonegap Windows Phone 7 Dynamic HTML loading and cross-domain calls using jQuery 使用jQuery的Phonegap Windows Phone 7动态HTML加载和跨域调用

"If Cordova is not initialized (ie the device ready has not fired), the browser control treats it like a remote get and lands you in to the usual Cross-Origin issue and rejects" This is probably the case for CSS. “如果未初始化Cordova(即尚未启动准备就绪的设备),则浏览器控件会将其视为远程获取,并使您进入常见的跨域问题并拒绝”。CSS可能就是这种情况。 May be you can try loading CSS dynamically after deviceready event and see what happen. 可能是您可以尝试在deviceready事件之后动态加载CSS,然后看看会发生什么。

Potentially this? 这可能吗? Windows phone supports web fonts. Windows Phone支持Web字体。 However, if they are embedded on the XAP they will not work. 但是,如果它们嵌入在XAP上,它们将无法工作。 This is a known issue, the only workaround we know is to host the fonts on a remote server and perhaps use AppCache to keep the font files locally on the device. 这是一个已知问题,我们知道的唯一解决方法是将字体托管在远程服务器上,并可能使用AppCache将字体文件保留在设备上的本地位置。

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

相关问题 如何通过绝对路径访问我的应用程序的文件 - Windows Phone - Phonegap / Cordova - how to access via absolute path to my application's file - windows phone - Phonegap/Cordova 如何使用PhoneGap / Cordova为Windows Phone 7创建简单的全景应用程序? - How do I create a simple panorama application for Windows Phone 7 using PhoneGap/Cordova? captureVideo破碎的Windows手机-PhoneGap - captureVideo broken windows phone - phonegap Phonegap + Windows Phone 8:视口元和缩放问题 - Phonegap + Windows Phone 8 : viewport meta & scaling issue 如何删除Windows Phone Phonegap中的底部空间? - how to remove bottom space in windows phone phonegap? Windows Phone 8.1(PhoneGap)中未显示某些SVG - Some SVGs not displaying in Windows Phone 8.1 (PhoneGap) 使用Phonegap进行Windows Phone 8应用开发 - Windows Phone 8 App Development using Phonegap Windows Phone PhoneGap应用程序中的localstorage无法正常工作 - localstorage is not working in Windows phone PhoneGap app 无法在PhoneGap Windows Phone 8中将图像加载到HTML5画布 - Can't load images to a HTML5 canvas in PhoneGap Windows Phone 8 Windows 8 Phone应用程序Phonegap 2.x Visual Studio 2010开发 - Windows 8 Phone application Phonegap 2.x Visual studio 2010 development
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM