2014-03-07 43 views
1

我为我的网站,一些字体和一些图标字体使用了一些@ font-face。 Icon-font在桌面和移动设备上运行良好,但字体(不是图标字体)在Windows Phone 8上不起作用。问题是什么?@ font-face在windows phone 8上无法正常工作

+3

定义“不工作”。哪个浏览器和版本?它在其他浏览器中工作吗?你有我们可以看到问题的网站吗?字体文件的路径是否正确?浏览器开发人员工具中是否有任何错误或警告显示? –

回答

1
  1. here@font-face网络类型)下载您的字体

  2. 复制您的字体文件(扩展名:eotwoffttfsvg)到目的地路径

  3. 更新CSS样式(基于相对字体路径)

    @font-face { 
        font-family:"B Yekan";src:url("fonts/Body/BYekan.eot?") format("eot"),url("fonts/Body/BYekan.woff") format("woff"),url("fonts/Body/BYekan.ttf") format("truetype"),url("fonts/Body/BYekan.svg#BYekan") format("svg"); 
        font-weight:normal; 
        font-style:normal; 
    } 
    
2

您的字体家族与您的src不匹配,那可能是为什么?

尝试:

@font-face { 
    font-family: 'B Yekan'; 
    src: url('fonts/Body/BYekan.eot?') format('eot'), 
    url('fonts/Body/BYekan.woff') format('woff'), 
    url('fonts/Body/BYekan.ttf') format('truetype'); 
} 

确保你的相对URL是正确的字体的位置了。

例如

src: url('/assets/fonts/Body/BYekan.eot?') format('eot'), 
1

我发现Chrome和Android WebView如何尝试拉取相对URL有些不一致。 Chrome从@font-face相对于包含CSS的目录拉动,而Android WebView(可能不太正确)从文档的目录中拉出。

也许WP8正在发生类似的情况。

您是否尝试过绝对网址?用相反的相对路径思想来选择相对路径呢?

相关问题