emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs/src term.c


From: Kenichi Handa
Subject: [Emacs-diffs] emacs/src term.c
Date: Wed, 04 Feb 2009 01:35:16 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Kenichi Handa <handa>   09/02/04 01:35:16

Modified files:
        src            : term.c 

Log message:
        (encode_terminal_code): Fix handling of composition.
        (produce_composite_glyph): For static composition, get pixel_width
        from struct composition.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/src/term.c?cvsroot=emacs&r1=1.235&r2=1.236

Patches:
Index: term.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/term.c,v
retrieving revision 1.235
retrieving revision 1.236
diff -u -b -r1.235 -r1.236
--- term.c      30 Jan 2009 23:45:29 -0000      1.235
+++ term.c      4 Feb 2009 01:35:16 -0000       1.236
@@ -627,7 +627,7 @@
                int c = LGLYPH_CHAR (g);
 
                if (! char_charset (c, charset_list, NULL))
-                 break;
+                 c = '?';
                buf += CHAR_STRING (c, buf);
                nchars++;
              }
@@ -636,15 +636,21 @@
              {
                int c = COMPOSITION_GLYPH (cmp, i);
 
-               if (! char_charset (c, charset_list, NULL))
-                 break;
-               buf += CHAR_STRING (c, buf);
+               if (c == '\t')
+                 continue;
+               if (char_charset (c, charset_list, NULL))
+                 {
+                   if (CHAR_WIDTH (c) == 0
+                       && i > 0 && COMPOSITION_GLYPH (cmp, i - 1) == '\t')
+                     /* Should be left-padded */
+                     {
+                       buf += CHAR_STRING (' ', buf);
                nchars++;
              }
-         if (i == 0)
-           {
-             /* The first character of the composition is not encodable.  */
-             *buf++ = '?';
+                 }
+               else
+                 c = '?';
+               buf += CHAR_STRING (c, buf);
              nchars++;
            }
        }
@@ -1811,8 +1817,7 @@
     {
       struct composition *cmp = composition_table[it->cmp_it.id];
 
-      c = COMPOSITION_GLYPH (cmp, 0);
-      it->pixel_width = CHAR_WIDTH (it->c);
+      it->pixel_width = cmp->width;
     }
   else
     {




reply via email to

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