diff options
| author | Kenichi Handa | 2008-08-29 07:57:13 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2008-08-29 07:57:13 +0000 |
| commit | 75a1078622818d6eaa5c98d50cabc8685eb8d3c7 (patch) | |
| tree | fcfc06aeefc2a41851e9bc1dc70446d9aff29d59 /src | |
| parent | 7e279d8975b089fdd7f3156e4e1bed16d3d439e1 (diff) | |
| download | emacs-75a1078622818d6eaa5c98d50cabc8685eb8d3c7.tar.gz emacs-75a1078622818d6eaa5c98d50cabc8685eb8d3c7.zip | |
(encode_terminal_code): Adjusted for the change of struct
glyph.
(append_composite_glyph): Adjusted for the change of struct it and
struct glyph.
(produce_composite_glyph): Likewise.
Diffstat (limited to 'src')
| -rw-r--r-- | src/term.c | 76 |
1 files changed, 60 insertions, 16 deletions
diff --git a/src/term.c b/src/term.c index 6303ceb3dca..367040288ef 100644 --- a/src/term.c +++ b/src/term.c | |||
| @@ -596,11 +596,21 @@ encode_terminal_code (src, src_len, coding) | |||
| 596 | { | 596 | { |
| 597 | if (src->type == COMPOSITE_GLYPH) | 597 | if (src->type == COMPOSITE_GLYPH) |
| 598 | { | 598 | { |
| 599 | struct composition *cmp = composition_table[src->u.cmp_id]; | 599 | struct composition *cmp; |
| 600 | Lisp_Object gstring; | ||
| 600 | int i; | 601 | int i; |
| 601 | 602 | ||
| 602 | nbytes = buf - encode_terminal_src; | 603 | nbytes = buf - encode_terminal_src; |
| 603 | required = MAX_MULTIBYTE_LENGTH * cmp->glyph_len; | 604 | if (src->u.cmp.automatic) |
| 605 | { | ||
| 606 | gstring = composition_gstring_from_id (src->u.cmp.id); | ||
| 607 | required = src->u.cmp.to - src->u.cmp.from; | ||
| 608 | } | ||
| 609 | else | ||
| 610 | { | ||
| 611 | cmp = composition_table[src->u.cmp.id]; | ||
| 612 | required = MAX_MULTIBYTE_LENGTH * cmp->glyph_len; | ||
| 613 | } | ||
| 604 | 614 | ||
| 605 | if (encode_terminal_src_size < nbytes + required) | 615 | if (encode_terminal_src_size < nbytes + required) |
| 606 | { | 616 | { |
| @@ -610,15 +620,27 @@ encode_terminal_code (src, src_len, coding) | |||
| 610 | buf = encode_terminal_src + nbytes; | 620 | buf = encode_terminal_src + nbytes; |
| 611 | } | 621 | } |
| 612 | 622 | ||
| 613 | for (i = 0; i < cmp->glyph_len; i++) | 623 | if (src->u.cmp.automatic) |
| 614 | { | 624 | for (i = src->u.cmp.from; i < src->u.cmp.to; i++) |
| 615 | int c = COMPOSITION_GLYPH (cmp, i); | 625 | { |
| 626 | Lisp_Object g = LGSTRING_GLYPH (gstring, i); | ||
| 627 | int c = LGLYPH_CHAR (g); | ||
| 616 | 628 | ||
| 617 | if (! char_charset (c, charset_list, NULL)) | 629 | if (! char_charset (c, charset_list, NULL)) |
| 618 | break; | 630 | break; |
| 619 | buf += CHAR_STRING (c, buf); | 631 | buf += CHAR_STRING (c, buf); |
| 620 | nchars++; | 632 | nchars++; |
| 621 | } | 633 | } |
| 634 | else | ||
| 635 | for (i = 0; i < cmp->glyph_len; i++) | ||
| 636 | { | ||
| 637 | int c = COMPOSITION_GLYPH (cmp, i); | ||
| 638 | |||
| 639 | if (! char_charset (c, charset_list, NULL)) | ||
| 640 | break; | ||
| 641 | buf += CHAR_STRING (c, buf); | ||
| 642 | nchars++; | ||
| 643 | } | ||
| 622 | if (i == 0) | 644 | if (i == 0) |
| 623 | { | 645 | { |
| 624 | /* The first character of the composition is not encodable. */ | 646 | /* The first character of the composition is not encodable. */ |
| @@ -1745,7 +1767,20 @@ append_composite_glyph (it) | |||
| 1745 | { | 1767 | { |
| 1746 | glyph->type = COMPOSITE_GLYPH; | 1768 | glyph->type = COMPOSITE_GLYPH; |
| 1747 | glyph->pixel_width = it->pixel_width; | 1769 | glyph->pixel_width = it->pixel_width; |
| 1748 | glyph->u.cmp_id = it->cmp_id; | 1770 | glyph->u.cmp.id = it->cmp_it.id; |
| 1771 | if (it->cmp_it.ch < 0) | ||
| 1772 | { | ||
| 1773 | glyph->u.cmp.automatic = 0; | ||
| 1774 | glyph->u.cmp.id = it->cmp_it.id; | ||
| 1775 | } | ||
| 1776 | else | ||
| 1777 | { | ||
| 1778 | glyph->u.cmp.automatic = 1; | ||
| 1779 | glyph->u.cmp.id = it->cmp_it.id; | ||
| 1780 | glyph->u.cmp.from = it->cmp_it.from; | ||
| 1781 | glyph->u.cmp.to = it->cmp_it.to; | ||
| 1782 | } | ||
| 1783 | |||
| 1749 | glyph->face_id = it->face_id; | 1784 | glyph->face_id = it->face_id; |
| 1750 | glyph->padding_p = 0; | 1785 | glyph->padding_p = 0; |
| 1751 | glyph->charpos = CHARPOS (it->position); | 1786 | glyph->charpos = CHARPOS (it->position); |
| @@ -1766,14 +1801,23 @@ static void | |||
| 1766 | produce_composite_glyph (it) | 1801 | produce_composite_glyph (it) |
| 1767 | struct it *it; | 1802 | struct it *it; |
| 1768 | { | 1803 | { |
| 1769 | struct composition *cmp = composition_table[it->cmp_id]; | ||
| 1770 | int c; | 1804 | int c; |
| 1771 | 1805 | ||
| 1772 | xassert (cmp->glyph_len > 0); | 1806 | if (it->cmp_it.ch < 0) |
| 1773 | c = COMPOSITION_GLYPH (cmp, 0); | 1807 | { |
| 1774 | it->pixel_width = CHAR_WIDTH (it->c); | 1808 | struct composition *cmp = composition_table[it->cmp_it.id]; |
| 1775 | it->nglyphs = 1; | ||
| 1776 | 1809 | ||
| 1810 | c = COMPOSITION_GLYPH (cmp, 0); | ||
| 1811 | it->pixel_width = CHAR_WIDTH (it->c); | ||
| 1812 | } | ||
| 1813 | else | ||
| 1814 | { | ||
| 1815 | Lisp_Object gstring = composition_gstring_from_id (it->cmp_it.id); | ||
| 1816 | |||
| 1817 | it->pixel_width = composition_gstring_width (gstring, it->cmp_it.from, | ||
| 1818 | it->cmp_it.to, NULL); | ||
| 1819 | } | ||
| 1820 | it->nglyphs = 1; | ||
| 1777 | if (it->glyph_row) | 1821 | if (it->glyph_row) |
| 1778 | append_composite_glyph (it); | 1822 | append_composite_glyph (it); |
| 1779 | } | 1823 | } |