locked
phonegap windows 8 and phonegap WP8 app dose not load font and data

    Question

  • Welcome everyone

    I am working on phonegap application, and my phonegap application contain font loaded using css and using $.get Method to load template and data from localhost but font, data and template was not loaded , and this app work successfully in android, blackberry and ios.

    this problem just occurs in windows 8 and windows phone

    this is my font

    @font-face
    {
    font-family:Granada ;
    src: url("fonts/AGA-Granada-V2.ttf");
    }

    here the $.get Method that i used to get data and template

    $data = null;
                $.get('li.tmpl', function (response) {
                    elementsTmpl = _.template(response);
                    $.each(titles, function (index, data) {
                        alert(data);
                        addItem(data);
                    });

    any one can help me ?

    note this app is working successfully in android, ios and blackberry 


    mhd

    Friday, July 5, 2013 12:26 PM

Answers

  • Hi Mohammed Oda,

    Thanks for posting!

    I think you are sure there are no other font-family declarations taking precedence over the declaration you've made? (this can be seen quite easily with the DOM Explorer).

    and you need add "formatic" in your code ,like this:

    @font-face
    {
    font-family:Granada ;
    src: url("fonts/AGA-Granada-V2.ttf") format('ttf'); 
    }

    If nothing else works, you might want to test some other font file, just in case that file is corrupt or something (some working examples from here, for instance).

    see this link:http://stackoverflow.com/questions/9770110/loading-custom-font-in-windows-8-metro-app

    Hope this helps!

    Wednesday, July 10, 2013 6:25 AM
    Moderator