Phonegap : Custom font is not working

久未见 提交于 2019-12-10 13:14:51

问题


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.

Thanks in advance


回答1:


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

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

try

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

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

Regards,



来源:https://stackoverflow.com/questions/30588348/phonegap-custom-font-is-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!