1

Iam new to cordova application development, i have a developed an online corodva app both in android and ios paltform in which arabic font is taking from the server, but it is displaying not in the correct font family , i want the font family "me_quran", serif.. I hope now the arabic text is showing as phone's default font family.

How can i show in the correct font family?? Thank You.

Eann
  • 83
  • 2
  • 12
  • If you run the site in a browser does the font work there and are you getting any error messages in the console? – AndrewTet Nov 11 '14 at 16:58

1 Answers1

3

I suspect that the font file isn't loading. Assuming you are using CSS, have you included the font source file? e.g.

@font-face { 
    font-family: "MeQuaran"; 
    src: url('me_quaran.ttf'); 
}

Place .ttf file in platforms/android/assets/www/ and you should be OK.

Charlie Dalsass
  • 1,986
  • 18
  • 23
  • I wrote the same answer, +1. This is probably whats wrong . . . – Ian Hazzard Nov 12 '14 at 01:28
  • Check to make sure your paths and filename are correct. – Charlie Dalsass Nov 13 '14 at 13:49
  • @Charlie, i am sure that my paths and file name are correct, but its not working .. – Eann Nov 21 '14 at 08:53
  • Do you have the css in a separate folder? If so, you may need to use ../ in front of the path (see http://stackoverflow.com/a/12457894/1620112). Finally, have you used Chrome's extremely useful web debugging tools? These tools can fully be used on Cordova now, via "ADB Plugin". This will allow you to see any broken files (use Network tab). See http://www.adamwadeharris.com/remote-debugging-in-phonegap-with-chrome-devtools/ – Charlie Dalsass Nov 21 '14 at 23:18
  • @charlie, i have tried all those steps, but still the same , i didnt get the correct output that i want. – Eann Nov 24 '14 at 12:17
  • Have you specified: body { font-family: MeQuaran !important; } in your CSS? – Charlie Dalsass Nov 24 '14 at 16:56