diff -dur pango-1.17.2/modules/thai/thai-lang.c pango-1.17.2-thai/modules/thai/thai-lang.c
--- pango-1.17.2/modules/thai/thai-lang.c	2007-01-23 10:41:44.000000000 +1100
+++ pango-1.17.2-thai/modules/thai/thai-lang.c	2007-06-09 22:24:14.000000000 +1000
@@ -21,6 +21,7 @@
 
 #include <string.h>
 #include <glib.h>
+#include <glib/gmessages.h>
 #include <pango/pango-engine.h>
 #include <pango/pango-break.h>
 #include <thai/thwchar.h>
@@ -77,21 +78,59 @@
 {
   thchar_t *tis_text;
 
+  pango_default_break(text, len, analysis, attrs, attrs_len);
+
   tis_text = utf8_to_tis (text, len);
   if (tis_text)
     {
       int brk_len = strlen ((const char*)tis_text) + 1;
       int *brk_pnts = g_new (int, brk_len);
       int brk_n;
-      int i;
+      int bi, ci;
+      gboolean in_word = FALSE;
 
       /* find line break positions */
       brk_n = th_brk (tis_text, brk_pnts, brk_len);
-      for (i = 0; i < brk_n; i++)
-	{
-	  attrs[brk_pnts[i]].is_line_break = TRUE;
-	  attrs[brk_pnts[i]].is_word_start = TRUE;
-	  attrs[brk_pnts[i]].is_word_end = TRUE;
+      bi = 0;
+      for (ci = 0; ci < attrs_len; ++ci)
+        {
+	  if (attrs[ci].is_word_end)
+	    {
+	      if (!in_word)
+	        g_warning("pango_default_break gave is_word_end when not in word");
+	      in_word = FALSE;
+	    }
+	  if (attrs[ci].is_word_start)
+	    {
+	      if (in_word)
+	        g_warning("pango_default_break gave is_word_start while still in word");
+	      in_word = TRUE;
+	    }
+
+	  if (ci == brk_pnts[bi])
+	    {
+	      if (in_word && !attrs[ci].is_word_start)
+	        {
+		  attrs[ci].is_line_break = TRUE;
+		  attrs[ci].is_word_start = TRUE;
+		  attrs[ci].is_word_end = TRUE;
+		}
+	      else
+	        {
+		  g_warning("th_brk indicated break other than in middle of (standard) word, not sure what to do; unichar ix=%i, pango_default_break said end=%d, brk=%d, start=%d",
+		  	    ci, attrs[ci].is_word_end, attrs[ci].is_line_break, attrs[ci].is_word_end);
+		  /* There's a good chance that pango_default_break is already doing the right thing
+		   * other than in the middle of a Thai word, so leave as is.  (Though I haven't looked
+		   * at the implementation of th_brk.) */
+		}
+	      ++bi;
+	      g_assert(bi == brk_n
+	               || ci < brk_pnts[bi]);
+	      /* Otherwise, sort and/or discard duplicates.  fixme: For
+	       * production code, we should change the assert to a warning, and
+	       * possibly add some defensive code e.g. to advance bi until that
+	       * condition is true. */
+	    }
 	}
 
       g_free (brk_pnts);
