diff -pruN -x .deps -x .libs pango-1.14.4.orig/pango/break.c pango-1.14.4/pango/break.c
--- pango-1.14.4.orig/pango/break.c	2006-09-14 07:04:26.000000000 +0900
+++ pango-1.14.4/pango/break.c	2006-09-29 00:04:55.000000000 +0900
@@ -520,7 +520,7 @@ pango_default_break (const gchar   *text
    * before we start, and then never assign %FALSE to anything
    */
 
-  const gchar *next;
+  const gchar *next, *next_next;
   gint i;
 
   gunichar prev_wc;
@@ -546,6 +546,7 @@ pango_default_break (const gchar   *text
   gint possible_sentence_boundary = -1;
   gboolean almost_done = FALSE;
   gboolean done = FALSE;
+  gboolean makes_rephaya_syllable = FALSE;
 
   g_return_if_fail (text != NULL);
   g_return_if_fail (attrs != NULL);
@@ -623,6 +624,13 @@ pango_default_break (const gchar   *text
 	  makes_hangul_syllable = (prev_end == this_start) || (prev_end + 1 == this_start);
 	}
 
+      /* Determine whether this forms a Rephaya syllable */
+      /* format should be something + U+0DBB U+0DCA U+200D + something */
+      if (prev_wc != 0 && wc == 0x0DBB && next_wc == 0x0DCA &&
+          next != NULL && (next_next = g_utf8_next_char (next)) != NULL &&
+          g_utf8_get_char (next_next) == 0x200D)
+        makes_rephaya_syllable = TRUE;
+
       /* Can't just use the type here since isspace() doesn't
        * correspond to a Unicode character type
        */
@@ -649,8 +657,27 @@ pango_default_break (const gchar   *text
            * cursor position at the start, which seems wrong to me
            * ???? - maybe it makes sense though, who knows)
            */
-          /* break after all format or control characters */
-          attrs[i].is_cursor_position = TRUE;
+          if (makes_rephaya_syllable && prev_wc == 0x200D)
+            {
+              attrs[i].is_cursor_position = FALSE;
+              /* this is last code */
+              makes_rephaya_syllable = FALSE;
+            }
+          else if (prev_wc == 0x200D &&
+                   (wc == 0x0DBB || wc == 0x0DBA))
+            {
+              /* do not break if previous character is ZWJ and
+               * current character is the kind of Yansaya,
+               * Rakaransaya or Rephaya.
+               * This is an optimization for Sinhala.
+               */
+              attrs[i].is_cursor_position = FALSE;
+            }
+          else
+            {
+              /* break after all format or control characters */
+              attrs[i].is_cursor_position = TRUE;
+            }
         }
       else
         {
@@ -658,8 +685,22 @@ pango_default_break (const gchar   *text
             {
             case G_UNICODE_CONTROL:
             case G_UNICODE_FORMAT:
-              /* Break before all format or control characters */
-              attrs[i].is_cursor_position = TRUE;
+              /* do not break if current character is ZWJ and
+               * next character is the kind of Yansaya,
+               * Rakaransaya or Rephaya.
+               * This is an optimization for Sinhala.
+               */
+              if (wc == 0x200D &&
+                  ((makes_rephaya_syllable && next_wc != 0) ||
+                   (next_wc == 0x0DBB || next_wc == 0x0DBA)))
+                {
+                  attrs[i].is_cursor_position = FALSE;
+                }
+              else
+                {
+                  /* Break before all format or control characters */
+                  attrs[i].is_cursor_position = TRUE;
+                }
               break;
 
             case G_UNICODE_COMBINING_MARK:
@@ -702,7 +743,11 @@ pango_default_break (const gchar   *text
 		   * viramas if we aren't part of a script that uses them.
                    */
 
-                  if (VIRAMA_SCRIPT (wc))
+                  if (makes_rephaya_syllable && wc == 0x0DBB)
+                    {
+                      attrs[i].is_cursor_position = FALSE;
+                    }
+                  else if (VIRAMA_SCRIPT (wc))
                     {
                       /* Check whether we're preceded by a virama; this
                        * could use some optimization.
