diff -ru qt-x11-free-3.3.7.orig/src/kernel/qscriptengine_x11.cpp qt-x11-free-3.3.7/src/kernel/qscriptengine_x11.cpp
--- qt-x11-free-3.3.7.orig/src/kernel/qscriptengine_x11.cpp	2006-10-19 19:55:15.000000000 +0530
+++ qt-x11-free-3.3.7/src/kernel/qscriptengine_x11.cpp	2008-01-05 09:36:10.000000000 +0530
@@ -1651,6 +1651,12 @@
         for (i = base+1; i < len; ++i)
             properties[i] &= ~PostSubstProperty;
 
+	// patch by suresh for Malayalam for traditional script conjuncts with postbase matra
+        if (script == QFont::Malayalam) {
+	    for (i = 0; i < len; ++i)
+            properties[i] &= ~PostSubstProperty;
+	}
+
         // halant always applies
 
 #ifdef INDIC_DEBUG
@@ -1686,6 +1692,41 @@
             }
         }
 
+	// patch by suresh for fixing Malayalam vattu ra glyph for reformed script
+
+	if (script == QFont::Malayalam 	/* && len-newLen < 4 */) {
+	   // test for a conjunct of same post-base consonants	
+	   if (reordered[base] == reordered[base+1])
+			base = base+2;
+	
+	   if (reordered[base+1] == 0x0d30 && reordered[base+2] == 0x0d4d){   									
+			int basePos = 0;
+			bool raSignFix = TRUE;										
+			while (basePos < newLen && (int)otl_glyphs[basePos].cluster <= base)													
+		   	basePos++;										
+			--basePos;
+			// don't apply fix for traditional script
+			if ((newLen-basePos == 1) 
+		   	|| (len > base+3 
+					&& newLen-basePos == 2
+					&& (form(reordered[base+3]) == Matra
+			   		|| form(reordered[base+3]) == LengthMark
+			  			|| form(reordered[base+3]) == VowelMark
+			    		|| form(reordered[base+3]) == Halant 
+			     )))
+		    raSignFix = FALSE;
+	
+			if (basePos <= newLen && raSignFix) {			
+		   	IDEBUG("moving halant + ra to position %d in syllable newlen=%d", basePos, newLen);	
+		   	OTL_GlyphItemRec r = otl_glyphs[basePos+1];						
+		   	OTL_GlyphItemRec b = otl_glyphs[basePos];
+							
+		   	otl_glyphs[basePos] = r;								
+		   	otl_glyphs[basePos+1] = b;
+			}		
+	    	}												
+	}
+
         if (!openType->positionAndAdd(item, FALSE))
             return FALSE;
 
@@ -1745,8 +1786,9 @@
         switch(newState) {
         case Control:
             newState = state;
- 	    if (state == Halant && uc[pos].unicode() == 0x200d /* ZWJ */)
-  		break;
+            // Patch by suresh for Malayalam for fixing chillu + postbase consonant + virama
+ 	    	  if (script != QFont::Malayalam && state == Halant && uc[pos].unicode() == 0x200d /* ZWJ */)
+					break;
             // the control character should be the last char in the item
             ++pos;
             goto finish;
@@ -1761,6 +1803,9 @@
             if (script == QFont::Bengali && pos == 1 &&
                  (uc[0].unicode() == 0x0985 || uc[0].unicode() == 0x098f))
                 break;
+	    // Patch by suresh for Malayalam SAMVRUTHOKARA
+	    if(script == QFont::Malayalam && uc[pos].unicode() == 0x0d4d && uc[pos-1].unicode() == 0x0d41)
+			   ++pos;
             goto finish;
         case Nukta:
             if (state == Consonant)
Only in qt-x11-free-3.3.7/src/kernel: qscriptengine_x11.cpp~
