Pango Warning: Error loading GDEF table 4097



Hi,

I have been using Pango (version 1.19.* ) for a couple of weeks for Arabic text rendering. Currently I am getting this warning with a simple program and am unable to find its cause.

(process:4826): Pango-WARNING **: Error loading GDEF table 4097

The font is Nafees Nastaleeq; I am just trying to write some Urdu text to a PNG file. Here's the code,


        #include <pango/pangocairo.h>
        #define FONT "Nafees Nastaleeq , Normal 32"
        //#define FONT "Sans, Normal 26"

        int main (int argc, char *argv[]){
        PangoFontMap *fontmap;
        PangoContext *context;
        PangoLayout *layout;
        PangoFontDescription *font_desc;
        const char * text = "Arabic: \330\247\331\204\330\263\331\204\330\271\331\204\331\212\331\203\331\205\n";
        const char * text3 = "Arabic:

نستعلیق\n";

        cairo_surface_t  *surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,300,300);
        cairo_t *cr = cairo_create (surface);
        cairo_set_source_rgb (cr,0.0,0.0,0.0);

        font_desc = pango_font_description_from_string(FONT);

        //fontmap = pango_cairo_font_map_get_default();
        //context = pango_cairo_font_map_create_context((PangoCairoFontMap *)fontmap);

        layout = pango_cairo_create_layout(cr);
        pango_layout_set_text (layout, text3, -1);
        pango_layout_set_font_description (layout, font_desc);

        pango_font_description_free(font_desc);

        pango_cairo_show_layout(cr,layout);

        cairo_surface_write_to_png (surface, "Arabic_text_with_Nafees_Nastaleeq.png");
      
        return 0;
        }


Is this a font-config error? Also, the warning disappears when the font-description is built with Sansas font-family; but then the output is a space-separated sequence of characters. With Nafees Nastaleeq also, the output text does not seem to be positioned correctly. PNG file for both are attached.

Another little query is regarding Harfbuzz. Does PangoLayout automatically uses Harfbuzz library when compiled or do we need to do some extra work? I was wondering if Pango uses Harfbuzz functions for opentype fonts like the one I mentioned.

Please bear with this basic stuff, but I really need to work this out.

Any help would be much appreciated.

Thanks

--

Rabia


--
Regards,
Rabia

Attachment: Arabic_text_with_Nafees_Nastaleeq.png
Description: PNG image

Attachment: Arabic_text_with_Sans.png
Description: PNG image



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]