diff -u -r -p pango1/modules/arabic/arabic-fc.c pango/modules/arabic/arabic-fc.c
--- pango1/modules/arabic/arabic-fc.c	2003-08-25 03:04:02.000000000 +0430
+++ pango/modules/arabic/arabic-fc.c	2003-08-25 02:54:29.000000000 +0430
@@ -248,7 +248,10 @@ arabic_engine_shape (PangoEngineShape *e
 	  else
 	    {
 	      set_glyph (font, glyphs, i, p - text, index);
-	      
+	      if(wc == 0x064D || wc==0x0650)
+		glyphs->glyphs[i].attr.is_kasra_or_kasratan = 1;
+	      else  
+		glyphs->glyphs[i].attr.is_kasra_or_kasratan = 0;
 	      if (g_unichar_type (wc) == G_UNICODE_NON_SPACING_MARK)
 		{
 		  if (i > 0)
diff -u -r -p pango1/pango/opentype/pango-ot-ruleset.c pango/pango/opentype/pango-ot-ruleset.c
--- pango1/pango/opentype/pango-ot-ruleset.c	2003-08-25 03:05:26.000000000 +0430
+++ pango/pango/opentype/pango-ot-ruleset.c	2003-08-25 02:53:26.000000000 +0430
@@ -519,6 +519,7 @@ pango_ot_ruleset_position (PangoOTRulese
 {
   int i;
   int result;
+  int mark_in_the_middle;
 
   TTO_GPOS gpos = NULL;
   TTO_GDEF gdef = NULL;
@@ -579,10 +580,20 @@ pango_ot_ruleset_position (PangoOTRulese
 	{
 	  PangoRectangle logical_rect; 
 	  FT_UShort property;
+	  mark_in_the_middle = 0;
 	  if (gdef &&
 	      TT_GDEF_Get_Glyph_Property (gdef, glyphs->glyphs[i].glyph, &property) == FT_Err_Ok &&
 	      (property == TTO_MARK || (property & IGNORE_SPECIAL_MARKS) != 0))
 	    {
+	      
+	      if((TT_GDEF_Get_Glyph_Property (gdef, glyphs->glyphs[i - 1].glyph, &property) == FT_Err_Ok &&
+		(property == TTO_MARK || (property & IGNORE_SPECIAL_MARKS) != 0 ) ||
+                 glyphs->glyphs[i-1].geometry.width >= 36000 )&& !glyphs->glyphs[i].attr.is_kasra_or_kasratan )
+	      {
+		glyphs->glyphs[i].geometry.x_offset = (int) logical_rect.width / 3;
+		mark_in_the_middle = 1;
+	      }
+
       	      glyphs->glyphs[i].geometry.width = 0;
 	    }
 	  else
@@ -594,7 +605,11 @@ pango_ot_ruleset_position (PangoOTRulese
       else
 	glyphs->glyphs[i].geometry.width = 0;
 
-      glyphs->glyphs[i].geometry.x_offset = 0;
+      if(!mark_in_the_middle)
+	{
+	      glyphs->glyphs[i].geometry.x_offset = 0;
+	}
+
       glyphs->glyphs[i].geometry.y_offset = 0;
 
     }
diff -u -r -p pango1/pango/pango-glyph.h pango/pango/pango-glyph.h
--- pango1/pango/pango-glyph.h	2003-08-25 03:04:19.000000000 +0430
+++ pango/pango/pango-glyph.h	2003-08-25 02:53:55.000000000 +0430
@@ -48,7 +48,8 @@ struct _PangoGlyphGeometry
  */
 struct _PangoGlyphVisAttr
 {
-  guint is_cluster_start : 1;
+  guint is_cluster_start : 1,
+	is_kasra_or_kasratan :1;
 };
 
 /* A single glyph 
