From: handa Date: Fri, 16 Jul 2004 04:25:21 +0000 (+0000) Subject: (compose_glyph_string): If a character's script is not X-Git-Tag: REL-1-1-0~101 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=89104d2e4e4a0574bea1b1cecc52fd8d9fe17d82;p=m17n%2Fm17n-lib.git (compose_glyph_string): If a character's script is not available, try searching backward before searching forward. --- diff --git a/src/draw.c b/src/draw.c index a33e4ff..53f9078 100644 --- a/src/draw.c +++ b/src/draw.c @@ -282,6 +282,21 @@ compose_glyph_string (MFrame *frame, MText *mt, int from, int to, if (this_script == Minherited || this_script == Mnil) this_script = script; if (this_script == Mnil) + /* Search backward for a character that explicitly + specifies a script. */ + for (i = pos - 1; i >= from; i--) + { + int c1 = mtext_ref_char (mt, i); + MSymbol sym = ((c1 > 0x20 && c1 < 0x100) ? Mlatin + : mchar_get_prop (c1, Mscript)); + + if (sym != Minherited && sym != Mnil) + { + this_script = sym; + break; + } + } + if (this_script == Mnil) /* Search forward for a character that explicitly specifies a script. */ for (i = pos + 1; i < to; i++)