trouble with arabic character spacing



hi,
i am having a little problem getting arabic text with tashkeel (diacritics?).
essentially, any text with them has random spacing between some of the
letters.  any text without it, however, doesn't have this problem.

here is a small clip from a gtktextview that illustrates what i am
saying:

www.prism.gatech.edu/~gte440v/other/tashkeel.png

as you may see, the text on the right side (w/o the diacritics) is fine,
whereas the text on the left is spaced out.  i've tried several fonts,
etc.  it seems to happen more as the font size gets larger.  i also
notice this same problem on my webbrowser too (firebird).

here is a snippet of code that i used to render that text.

   /* get the gtk text view */
   w = GTK_WIDGET(lookup_widget(GTK_WIDGET(widget), "suraText"));
   /* create a new text buffer */
   tb = gtk_text_buffer_new(NULL);
   gtk_text_buffer_get_start_iter(tb, &textIter);

   /* get and set the font -- this can be Sans 22 or Tahoma 22, the 
      result is the same */
   fd = pango_font_description_from_string("KacstQr 22");
   gtk_widget_modify_font(GTK_WIDGET(w), fd);
   pango_font_description_free (fd);
   
   /* obtain the text */
   ayah = quran_read_verse(q, 1, 1, &ctx);

   /* create the tag */
   tag = gtk_text_buffer_create_tag(tb, "titletag", "justification",
                                    GTK_JUSTIFY_CENTER, "direction",
                                    GTK_TEXT_DIR_RTL, NULL);

   /* insert the text */
   gtk_text_buffer_insert_with_tags(tb, &textIter, ayah, -1, tag, NULL);
   gtk_text_view_set_buffer(GTK_TEXT_VIEW(w), tb);


i'd appreciate any help in this matter.
thanks,
-ahmed
-- 
ahmed el-helw



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