diff options
| author | Kenichi Handa | 2009-02-04 01:35:16 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2009-02-04 01:35:16 +0000 |
| commit | d0984aff9503b9a685e67a50f0a16e8799131ede (patch) | |
| tree | 7656f94ce69d082e62bd8a0581b79e2ca49a7765 /src | |
| parent | ce65fe7a4e75b3d6e3a433a1e5e9a1a0ce1163bf (diff) | |
| download | emacs-d0984aff9503b9a685e67a50f0a16e8799131ede.tar.gz emacs-d0984aff9503b9a685e67a50f0a16e8799131ede.zip | |
(encode_terminal_code): Fix handling of composition.
(produce_composite_glyph): For static composition, get pixel_width
from struct composition.
Diffstat (limited to 'src')
| -rw-r--r-- | src/term.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/src/term.c b/src/term.c index 0cfc1ff3b95..c425337fe71 100644 --- a/src/term.c +++ b/src/term.c | |||
| @@ -627,7 +627,7 @@ encode_terminal_code (src, src_len, coding) | |||
| 627 | int c = LGLYPH_CHAR (g); | 627 | int c = LGLYPH_CHAR (g); |
| 628 | 628 | ||
| 629 | if (! char_charset (c, charset_list, NULL)) | 629 | if (! char_charset (c, charset_list, NULL)) |
| 630 | break; | 630 | c = '?'; |
| 631 | buf += CHAR_STRING (c, buf); | 631 | buf += CHAR_STRING (c, buf); |
| 632 | nchars++; | 632 | nchars++; |
| 633 | } | 633 | } |
| @@ -636,17 +636,23 @@ encode_terminal_code (src, src_len, coding) | |||
| 636 | { | 636 | { |
| 637 | int c = COMPOSITION_GLYPH (cmp, i); | 637 | int c = COMPOSITION_GLYPH (cmp, i); |
| 638 | 638 | ||
| 639 | if (! char_charset (c, charset_list, NULL)) | 639 | if (c == '\t') |
| 640 | break; | 640 | continue; |
| 641 | if (char_charset (c, charset_list, NULL)) | ||
| 642 | { | ||
| 643 | if (CHAR_WIDTH (c) == 0 | ||
| 644 | && i > 0 && COMPOSITION_GLYPH (cmp, i - 1) == '\t') | ||
| 645 | /* Should be left-padded */ | ||
| 646 | { | ||
| 647 | buf += CHAR_STRING (' ', buf); | ||
| 648 | nchars++; | ||
| 649 | } | ||
| 650 | } | ||
| 651 | else | ||
| 652 | c = '?'; | ||
| 641 | buf += CHAR_STRING (c, buf); | 653 | buf += CHAR_STRING (c, buf); |
| 642 | nchars++; | 654 | nchars++; |
| 643 | } | 655 | } |
| 644 | if (i == 0) | ||
| 645 | { | ||
| 646 | /* The first character of the composition is not encodable. */ | ||
| 647 | *buf++ = '?'; | ||
| 648 | nchars++; | ||
| 649 | } | ||
| 650 | } | 656 | } |
| 651 | /* We must skip glyphs to be padded for a wide character. */ | 657 | /* We must skip glyphs to be padded for a wide character. */ |
| 652 | else if (! CHAR_GLYPH_PADDING_P (*src)) | 658 | else if (! CHAR_GLYPH_PADDING_P (*src)) |
| @@ -1811,8 +1817,7 @@ produce_composite_glyph (it) | |||
| 1811 | { | 1817 | { |
| 1812 | struct composition *cmp = composition_table[it->cmp_it.id]; | 1818 | struct composition *cmp = composition_table[it->cmp_it.id]; |
| 1813 | 1819 | ||
| 1814 | c = COMPOSITION_GLYPH (cmp, 0); | 1820 | it->pixel_width = cmp->width; |
| 1815 | it->pixel_width = CHAR_WIDTH (it->c); | ||
| 1816 | } | 1821 | } |
| 1817 | else | 1822 | else |
| 1818 | { | 1823 | { |