html - How to add custom font in PhoneGap -


i trying add custom font phonegap application , tried 2 methods found on internet , don't work using phonegap 3 , xcode 5.

  • using font-face method using css:

    @font-face {            font-family: 'droid arabic kufi';            src: url('fonts/droidkufi-regular.ttf');          }  body {      font-family: 'droid arabic kufi';    } 

    using xcode info.plist file method:

    1. first added droidkufi-regular.ttf in project resources folder.

    2. then added new row in info.plist file called fonts provided application item called droidkufi-regular.ttf. , still doesn't work.

    3. so, in viewdidload method added line of code [uifont fontwithname:@"droid arabic kufi" size:10.0]; still not working.

this works in app. 'fonts' subdirectory in directory css file.

@font-face {     font-family: 'grenouille';     src: url('fonts/grenouille.eot');     src: local('☺'), url('fonts/grenouille.woff') format('woff'), url('fonts/grenouille.ttf') format('truetype'), url('fonts/grenouille.svg') format('svg');     font-weight: normal;     font-style: normal; }  h1 {     font-family: "grenouille"; } 

i'm not sure need these files, can generate them using site http://www.fontsquirrel.com/tools/webfont-generator

if still have problems, check letter cases, remove spaces names , try apply preinstalled font family sure problem font , not css rules.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -