7

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 Answers1

2

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,

Palvinder
  • 1,447
  • 1
  • 10
  • 9
  • 1
    how can i access from root folder, we don't have access for root folder @Palvinder –  Jun 03 '15 at 04:43
  • Is the style you've shown above in the html file or separate css file? If its in your html file and I presume the html file is in the root of your project folder, along with a fonts folder then changing the paths to point to /fonts/cooperblackstd.eot etc (looking at the leading /) will ensure you have referenced them correctly. Also i had a similar issue in an app where appending the **/** seemed to fix broken links to an image set via javascript in a hybrid android app (but work fine on my local desktop). – Palvinder Jun 03 '15 at 09:14