X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fdraw.c;h=1fef78a1c1885be74b2aca4c771d59daa492c4c9;hb=1b7bcea372680c0e52493e54e3b4c2e16744101d;hp=7fdb90c9252de66c5536711fd36c3a3edbf06efc;hpb=0a77713e8fd62b29e23676ec4d9d02644dc6ba41;p=m17n%2Fm17n-lib.git diff --git a/src/draw.c b/src/draw.c index 7fdb90c..1fef78a 100644 --- a/src/draw.c +++ b/src/draw.c @@ -1,5 +1,5 @@ /* draw.c -- drawing module. - Copyright (C) 2003, 2004, 2005, 2006, 2007 + Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 National Institute of Advanced Industrial Science and Technology (AIST) Registration Number H15PRO112 @@ -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; @@ -546,7 +549,6 @@ compose_glyph_string (MFrame *frame, MText *mt, int from, int to, for (g++; (g->type == GLYPH_CHAR - && g->g.from != gstring->control.cursor_pos && g->rface->layouter == this->rface->layouter && (g->rface->rfont == this->rface->rfont || (g->category == GLYPH_CATEGORY_FORMATTER