Fix comment on parse_otf_command.
[m17n/m17n-lib.git] / src / draw.c
index 5025759..1fef78a 100644 (file)
@@ -225,9 +225,10 @@ visual_order (MGlyphString *gstring)
   for (i = 1; i < gstring->used - 1; i++)
     {
       MGlyph *g = gstring->glyphs + i;
+      int level = g->bidi_level;
 
       for (j = i; g->g.from == gstring->glyphs[j + 1].g.from; j++);
-      if (j > i)
+      if ((level % 2) && j > i)
        {
          memcpy (glyphs + i, gstring->glyphs + i,
                  sizeof (MGlyph) * (j - i + 1));
@@ -483,6 +484,8 @@ compose_glyph_string (MFrame *frame, MText *mt, int from, int to,
                    break;
                  }
            }
+         if (this_script == Minherited || this_script == Mcommon)
+           this_script = (MSymbol) mchar_get_prop (c, Mblock);
        }
 
       pos = g->g.from;