diff -crB pango-1.24.4.old2/pango/pango-context.c pango-1.24.4/pango/pango-context.c
*** pango-1.24.4.old2/pango/pango-context.c	2009-06-11 05:27:00.000000000 +0200
--- pango-1.24.4/pango/pango-context.c	2009-07-21 22:55:13.000000000 +0200
***************
*** 645,655 ****
    SCRIPT_CHANGED       = 1 << 1,
    LANG_CHANGED         = 1 << 2,
    FONT_CHANGED         = 1 << 3,
!   DERIVED_LANG_CHANGED = 1 << 4
  } ChangedFlags;
  
  typedef struct _ItemizeState ItemizeState;
  
  struct _ItemizeState
  {
    PangoContext *context;
--- 645,671 ----
    SCRIPT_CHANGED       = 1 << 1,
    LANG_CHANGED         = 1 << 2,
    FONT_CHANGED         = 1 << 3,
!   DERIVED_LANG_CHANGED = 1 << 4,
!   WIDTH_CHANGED        = 1 << 5
  } ChangedFlags;
  
+ 
+ 
+ typedef struct _PangoWidthIter PangoWidthIter;
+ 
+ struct _PangoWidthIter
+ {
+ 	const gchar *all_start;
+ 	const gchar *all_end;
+ 	const gchar *start;
+ 	const gchar *end;
+ 	gboolean wide;
+ };
+ 
  typedef struct _ItemizeState ItemizeState;
  
+ 
+ 
  struct _ItemizeState
  {
    PangoContext *context;
***************
*** 697,702 ****
--- 713,720 ----
  
    GSList *exact_engines;
    GSList *fallback_engines;
+ 
+   PangoWidthIter width_iter;
  };
  
  static void
***************
*** 777,782 ****
--- 795,832 ----
      state->run_end = state->attr_end;
    if (state->script_end < state->run_end)
      state->run_end = state->script_end;
+   if (state->width_iter.end < state->run_end)
+     state->run_end = state->width_iter.end;
+ }
+ 
+ static void
+ width_iter_next(PangoWidthIter* iter)
+ {
+   iter->start=iter->end;
+ 
+   if (iter->end < iter->all_end)
+     {
+       gunichar ch = g_utf8_get_char (iter->end);
+       iter->wide = g_unichar_iswide (ch);
+     }
+ 
+   while (iter->end < iter->all_end)
+     {
+       gunichar ch=g_utf8_get_char (iter->end);
+       if (g_unichar_iswide (ch) != iter->wide)
+         break;
+       iter->end = g_utf8_next_char (iter->end);
+     }
+ }
+ 
+ static void
+ width_iter_init (PangoWidthIter* iter, const char* start, const char* end)
+ {
+   iter->all_start = start;
+   iter->all_end = end;
+   iter->end = start;
+ 
+   width_iter_next (iter);
  }
  
  static void
***************
*** 852,857 ****
--- 902,910 ----
    pango_script_iter_get_range (&state->script_iter, NULL,
  			       &state->script_end, &state->script);
  
+   /* Initialize the width iterator */
+   width_iter_init (&state->width_iter, text + start_index, text + start_index + length);
+ 
    update_end (state);
  
    if (pango_font_description_get_set_fields (state->font_desc) & PANGO_FONT_MASK_GRAVITY)
***************
*** 871,877 ****
    state->fallback_engines = NULL;
    state->base_font = NULL;
  
!   state->changed = EMBEDDING_CHANGED | SCRIPT_CHANGED | LANG_CHANGED | FONT_CHANGED;
  }
  
  static gboolean
--- 924,930 ----
    state->fallback_engines = NULL;
    state->base_font = NULL;
  
!   state->changed = EMBEDDING_CHANGED | SCRIPT_CHANGED | LANG_CHANGED | FONT_CHANGED | WIDTH_CHANGED;
  }
  
  static gboolean
***************
*** 902,907 ****
--- 955,965 ----
  				   &state->script_end, &state->script);
        state->changed |= SCRIPT_CHANGED;
      }
+   if (state->run_end == state->width_iter.end)
+     {
+       width_iter_next (&state->width_iter);
+       state->changed |= WIDTH_CHANGED;
+     }
  
    update_end (state);
  
***************
*** 1231,1237 ****
  {
    /* This block should be moved to update_attr_iterator, but I'm too lazy to
     * do it right now */
!   if (state->changed & (FONT_CHANGED | SCRIPT_CHANGED))
      {
        PangoGravity old_gravity = state->resolved_gravity;
  
--- 1289,1295 ----
  {
    /* This block should be moved to update_attr_iterator, but I'm too lazy to
     * do it right now */
!   if (state->changed & (FONT_CHANGED | SCRIPT_CHANGED | WIDTH_CHANGED))
      {
        PangoGravity old_gravity = state->resolved_gravity;
  
***************
*** 1239,1244 ****
--- 1297,1306 ----
  	{
  	  state->resolved_gravity = state->font_desc_gravity;
  	}
+       else if (state->width_iter.wide)
+         {
+           state->resolved_gravity = state->context->resolved_gravity;
+         }
        else
  	{
  	  PangoGravity gravity = state->gravity;
diff -crB pango-1.24.4.old2/pango/pango-script.c pango-1.24.4/pango/pango-script.c
*** pango-1.24.4.old2/pango/pango-script.c	2009-05-21 15:10:01.000000000 +0200
--- pango-1.24.4/pango/pango-script.c	2009-07-21 23:03:07.000000000 +0200
***************
*** 303,308 ****
--- 303,318 ----
  	    }
  	}
  
+       /* Treat these characters as either hiragana or katakana characters */
+       if ((ch >> 8) == 0x30
+           && ((ch >= 0x3031 && ch <= 0x3035) || ch == 0x309B || ch == 0x309C || ch == 0x30A0 || ch == 0x30FC))
+ 	{
+ 	  if (iter->script_code == PANGO_SCRIPT_HIRAGANA)
+ 	    sc = PANGO_SCRIPT_HIRAGANA;
+ 	  else
+ 	    sc = PANGO_SCRIPT_KATAKANA;
+ 	}
+ 
        if (SAME_SCRIPT (iter->script_code, sc))
  	{
  	  if (!REAL_SCRIPT (iter->script_code) && REAL_SCRIPT (sc))
