emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r110126: composite.c (composition_res


From: Kenichi Handa
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110126: composite.c (composition_reseat_it): Handle the case that a grapheme cluster is not covered by a single font (Bug#12352).
Date: Sat, 22 Sep 2012 11:26:42 +0900
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110126 [merge]
committer: Kenichi Handa <address@hidden>
branch nick: trunk
timestamp: Sat 2012-09-22 11:26:42 +0900
message:
  composite.c (composition_reseat_it): Handle the case that a grapheme cluster 
is not covered by a single font (Bug#12352).
modified:
  src/ChangeLog
  src/composite.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-09-21 03:52:23 +0000
+++ b/src/ChangeLog     2012-09-22 02:26:05 +0000
@@ -1,3 +1,8 @@
+2012-09-22  Kenichi Handa  <address@hidden>
+
+       * composite.c (composition_reseat_it): Handle the case that a
+       grapheme cluster is not covered by a single font (Bug#12352).
+
 2012-09-21  Chong Yidong  <address@hidden>
 
        * image.c (define_image_type): Avoid adding duplicate types to
@@ -163,7 +168,7 @@
        (clean): Simplify nextstep entry.
        * ns.mk: Remove file.
 
-2012-09-16  Kenichi Handa  <address@hidden>
+2012-09-17  Kenichi Handa  <address@hidden>
 
        * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
        not covert the last few charactes.

=== modified file 'src/composite.c'
--- a/src/composite.c   2012-09-15 07:06:56 +0000
+++ b/src/composite.c   2012-09-22 02:15:29 +0000
@@ -1219,9 +1219,6 @@
                       ptrdiff_t bytepos, ptrdiff_t endpos, struct window *w,
                       struct face *face, Lisp_Object string)
 {
-  if (endpos < 0)
-    endpos = NILP (string) ? BEGV : 0;
-
   if (cmp_it->ch == -2)
     {
       composition_compute_stop_pos (cmp_it, charpos, bytepos, endpos, string);
@@ -1230,6 +1227,9 @@
        return 0;
     }
 
+  if (endpos < 0)
+    endpos = NILP (string) ? BEGV : 0;
+
   if (cmp_it->ch < 0)
     {
       /* We are looking at a static composition.  */
@@ -1277,36 +1277,23 @@
        {
          ptrdiff_t cpos = charpos, bpos = bytepos;
 
-         while (1)
-           {
-             elt = XCAR (val);
-             if (cmp_it->lookback > 0)
-               {
-                 cpos = charpos - cmp_it->lookback;
-                 if (STRINGP (string))
-                   bpos = string_char_to_byte (string, cpos);
-                 else
-                   bpos = CHAR_TO_BYTE (cpos);
-               }
-             lgstring = autocmp_chars (elt, cpos, bpos, charpos + 1, w, face,
-                                       string);
-             if (composition_gstring_p (lgstring)
-                 && cpos + LGSTRING_CHAR_LEN (lgstring) - 1 == charpos)
-               break;
-             /* Composition failed or didn't cover the current
-                character.  */
-             if (cmp_it->lookback == 0)
-               goto no_composition;
-             lgstring = Qnil;
-             /* Try to find a shorter composition that starts after CPOS.  */
-             composition_compute_stop_pos (cmp_it, charpos, bytepos, cpos,
-                                           string);
-             if (cmp_it->ch == -2 || cmp_it->stop_pos < charpos)
-               goto no_composition;
-             val = CHAR_TABLE_REF (Vcomposition_function_table, cmp_it->ch);
-             for (i = 0; i < cmp_it->rule_idx; i++, val = XCDR (val));
-           }
          cmp_it->reversed_p = 1;
+         elt = XCAR (val);
+         if (cmp_it->lookback > 0)
+           {
+             cpos = charpos - cmp_it->lookback;
+             if (STRINGP (string))
+               bpos = string_char_to_byte (string, cpos);
+             else
+               bpos = CHAR_TO_BYTE (cpos);
+           }
+         lgstring = autocmp_chars (elt, cpos, bpos, charpos + 1, w, face,
+                                   string);
+         if (! composition_gstring_p (lgstring)
+             || cpos + LGSTRING_CHAR_LEN (lgstring) - 1 != charpos)
+           /* Composition failed or didn't cover the current
+              character.  */
+           goto no_composition;
        }
       if (NILP (lgstring))
        goto no_composition;
@@ -1341,6 +1328,8 @@
       /* BYTEPOS is calculated in composition_compute_stop_pos */
       bytepos = -1;
     }
+  if (cmp_it->reversed_p)
+    endpos = -1;
   composition_compute_stop_pos (cmp_it, charpos, bytepos, endpos, string);
   return 0;
 }


reply via email to

[Prev in Thread] Current Thread [Next in Thread]