emacs-diffs
[Top][All Lists]
Advanced

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

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


From: Kenichi Handa
Subject: [Emacs-diffs] Changes to emacs/src/term.c,v
Date: Fri, 29 Aug 2008 07:57:14 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Kenichi Handa <handa>   08/08/29 07:57:14

Index: term.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/term.c,v
retrieving revision 1.226
retrieving revision 1.227
diff -u -b -r1.226 -r1.227
--- term.c      26 Aug 2008 03:12:05 -0000      1.226
+++ term.c      29 Aug 2008 07:57:13 -0000      1.227
@@ -596,11 +596,21 @@
     {
       if (src->type == COMPOSITE_GLYPH)
        {
-         struct composition *cmp = composition_table[src->u.cmp_id];
+         struct composition *cmp;
+         Lisp_Object gstring;
          int i;
 
          nbytes = buf - encode_terminal_src;
+         if (src->u.cmp.automatic)
+           {
+             gstring = composition_gstring_from_id (src->u.cmp.id);
+             required = src->u.cmp.to - src->u.cmp.from;
+           }
+         else
+           {
+             cmp = composition_table[src->u.cmp.id];
          required = MAX_MULTIBYTE_LENGTH * cmp->glyph_len;
+           }
 
          if (encode_terminal_src_size < nbytes + required)
            {
@@ -610,6 +620,18 @@
              buf = encode_terminal_src + nbytes;
            }
 
+         if (src->u.cmp.automatic)
+           for (i = src->u.cmp.from; i < src->u.cmp.to; i++)
+             {
+               Lisp_Object g = LGSTRING_GLYPH (gstring, i);
+               int c = LGLYPH_CHAR (g);
+
+               if (! char_charset (c, charset_list, NULL))
+                 break;
+               buf += CHAR_STRING (c, buf);
+               nchars++;
+             }
+         else
          for (i = 0; i < cmp->glyph_len; i++)
            {
              int c = COMPOSITION_GLYPH (cmp, i);
@@ -1745,7 +1767,20 @@
     {
       glyph->type = COMPOSITE_GLYPH;
       glyph->pixel_width = it->pixel_width;
-      glyph->u.cmp_id = it->cmp_id;
+      glyph->u.cmp.id = it->cmp_it.id;
+      if (it->cmp_it.ch < 0)
+       {
+         glyph->u.cmp.automatic = 0;
+         glyph->u.cmp.id = it->cmp_it.id;
+       }
+      else
+       {
+         glyph->u.cmp.automatic = 1;
+         glyph->u.cmp.id = it->cmp_it.id;
+         glyph->u.cmp.from = it->cmp_it.from;
+         glyph->u.cmp.to = it->cmp_it.to;
+       }
+
       glyph->face_id = it->face_id;
       glyph->padding_p = 0;
       glyph->charpos = CHARPOS (it->position);
@@ -1766,14 +1801,23 @@
 produce_composite_glyph (it)
      struct it *it;
 {
-  struct composition *cmp = composition_table[it->cmp_id];
   int c;
 
-  xassert (cmp->glyph_len > 0);
+  if (it->cmp_it.ch < 0)
+    {
+      struct composition *cmp = composition_table[it->cmp_it.id];
+
   c = COMPOSITION_GLYPH (cmp, 0);
   it->pixel_width = CHAR_WIDTH (it->c);
-  it->nglyphs = 1;
+    }
+  else
+    {
+      Lisp_Object gstring = composition_gstring_from_id (it->cmp_it.id);
 
+      it->pixel_width = composition_gstring_width (gstring, it->cmp_it.from,
+                                                  it->cmp_it.to, NULL);
+    }
+  it->nglyphs = 1;
   if (it->glyph_row)
     append_composite_glyph (it);
 }




reply via email to

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