[英]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.