From 89104d2e4e4a0574bea1b1cecc52fd8d9fe17d82 Mon Sep 17 00:00:00 2001 From: handa Date: Fri, 16 Jul 2004 04:25:21 +0000 Subject: [PATCH] (compose_glyph_string): If a character's script is not available, try searching backward before searching forward. --- src/draw.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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++) -- 1.7.10.4