简体   繁体   中英

Phonegap : Custom font is not working

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

Can you try relative path from root folder, ie 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,

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM