PhoneGap的:自定义字体不能正常工作 [英] Phonegap : Custom font is not working

查看:350
本文介绍了PhoneGap的:自定义字体不能正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做使用自定义字体样式在PhoneGap的应用程序。字体样式正在浏览器,但在Android手机而不是索取。

I am doing an application in PhoneGap using custom font style. The font style is taking in browser , but not taking in Android phone.

<style>    
 @font-face {
        font-family: 'CooperStd';
        src: url('fonts/cooperblackstd.eot');
        src: url('fonts/cooperblackstd.eot?#iefix') format('embedded-opentype'),
            url('fonts/cooperblackstd.woff') format('woff'),
            url('fonts/cooperblackstd.ttf')  format('truetype'),
            url('fonts/cooperblackstd.svg#CooperBlackStd') format('svg');
        font-weight: 900;
        font-style: normal;
    }


body{font-family:'CooperStd' , arial ;   }

</style>

我查了字体路径,这是正确的浏览器同时检查控制台。没有错误,我发现。

I checked the font path , it is correct also check console in browser. There is no error that I found.

在此先感谢

推荐答案

你可以尝试,而不是从根目录的相对路径,即:

Can you try relative path from root folder, i.e instead of:

src: url('fonts/cooperblackstd.eot');

尝试

src: url('/fonts/cooperblackstd.eot');

presuming字体是一个文件夹在同一级别为www文件夹下的.html文件。

presuming fonts is a folder at the same level as your .html file under the www folder.

问候,

这篇关于PhoneGap的:自定义字体不能正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆