how to use custom font in phone gap?

android, cordova

Solution

<style type="text/css" media="screen">
        @font-face {
            font-family: centurySchoolbook;
            src: url(/fonts/century-schoolbook.ttf);
        }
       body {
           font-family: centurySchoolbook;
           font-size:30px;
       }
</style>

If your font still doesn't work, make sure you're spelling its typeface name and its file name correctly, your app caches are behaving, your mobile OS isn't messing around with a font. check the css overwriting things first.

Problem

I'm using phonegap to build android application and I face some problem. ``` <style type="text/css"> @font-face{ font-family: customfont; src: url("fonts/THSarabunNew.ttf") format('truetype'); } body { font-family: customfont; font-size:30px; } </style> ``` I try to use this code in index.html file but I cannot use my custom font in application. please tell me a way to use custom font in phonegap on android app. thanks

Original source