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:
first added droidkufi-regular.ttf in project resources folder.
then added new row in info.plist file called
fonts provided application
item calleddroidkufi-regular.ttf
. , still doesn't work.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
Post a Comment