emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/src/font.c,v


From: Kenichi Handa
Subject: [Emacs-diffs] Changes to emacs/src/font.c,v
Date: Wed, 10 Sep 2008 05:54:10 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Kenichi Handa <handa>   08/09/10 05:54:10

Index: font.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/font.c,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -b -r1.82 -r1.83
--- font.c      29 Aug 2008 09:54:05 -0000      1.82
+++ font.c      10 Sep 2008 05:54:09 -0000      1.83
@@ -4224,7 +4224,7 @@
 {
   struct font *font;
   Lisp_Object font_object, n, glyph;
-  int i;
+  int i, j, from, to;
   
   if (! composition_gstring_p (gstring))
     signal_error ("Invalid glyph-string: ", gstring);
@@ -4250,22 +4250,41 @@
     return Qnil;
   
   glyph = LGSTRING_GLYPH (gstring, 0);
-  for (i = 1; i < LGSTRING_GLYPH_LEN (gstring); i++)
+  from = LGLYPH_FROM (glyph);
+  to = LGLYPH_TO (glyph);
+  for (i = 1, j = 0; i < LGSTRING_GLYPH_LEN (gstring); i++)
     {
       Lisp_Object this = LGSTRING_GLYPH (gstring, i);
 
       if (NILP (this))
        break;
       if (NILP (LGLYPH_ADJUSTMENT (this)))
-       glyph = this;
+       {
+         if (j < i - 1)
+           for (; j < i; j++)
+             {
+               glyph = LGSTRING_GLYPH (gstring, j);
+               LGLYPH_SET_FROM (glyph, from);
+               LGLYPH_SET_TO (glyph, to);
+             }
+         from = LGLYPH_FROM (this);
+         to = LGLYPH_TO (this);
+         j = i;
+       }
       else
        {
-         int from = LGLYPH_FROM (glyph);
-         int to = LGLYPH_TO (glyph);
-
-         LGLYPH_SET_FROM (this, from);
-         LGLYPH_SET_TO (this, to);
+         if (from > LGLYPH_FROM (this))
+           from = LGLYPH_FROM (this);
+         if (to < LGLYPH_TO (this))
+           to = LGLYPH_TO (this);
+       }
        }
+  if (j < i - 1)
+    for (; j < i; j++)
+      {
+       glyph = LGSTRING_GLYPH (gstring, j);
+       LGLYPH_SET_FROM (glyph, from);
+       LGLYPH_SET_TO (glyph, to);
     }
   return composition_gstring_put_cache (gstring, XINT (n));
 }




reply via email to

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