828 |
register int tlen = GLYPH_TABLE_LENGTH; |
register int tlen = GLYPH_TABLE_LENGTH; |
829 |
register Lisp_Object *tbase = GLYPH_TABLE_BASE; |
register Lisp_Object *tbase = GLYPH_TABLE_BASE; |
830 |
struct coding_system *coding; |
struct coding_system *coding; |
831 |
|
Lisp_Object attrs, charset_list; |
832 |
|
|
833 |
|
#if 1 |
834 |
|
/* GLYPH-TABLE is not supported anymore in xdisp.c. */ |
835 |
|
tlen = 0; |
836 |
|
#endif |
837 |
|
|
838 |
/* If terminal_coding does any conversion, use it, otherwise use |
/* If terminal_coding does any conversion, use it, otherwise use |
839 |
safe_terminal_coding. We can't use CODING_REQUIRE_ENCODING here |
safe_terminal_coding. We can't use CODING_REQUIRE_ENCODING here |
844 |
coding->destination = terminal_encode_buffer; |
coding->destination = terminal_encode_buffer; |
845 |
coding->dst_bytes = terminal_encode_buf_size; |
coding->dst_bytes = terminal_encode_buf_size; |
846 |
coding->mode |= CODING_MODE_LAST_BLOCK; |
coding->mode |= CODING_MODE_LAST_BLOCK; |
847 |
|
attrs = CODING_ID_ATTRS (coding->id); |
848 |
|
charset_list = CODING_ATTR_CHARSET_LIST (attrs); |
849 |
|
|
850 |
workbuf = buf = alloca (MAX_MULTIBYTE_LENGTH * src_len); |
workbuf = buf = alloca (MAX_MULTIBYTE_LENGTH * src_len); |
851 |
for (nchars = 0; src < src_end; src++) |
for (nchars = 0; src < src_end; src++) |
875 |
|
|
876 |
if (NILP (string)) |
if (NILP (string)) |
877 |
{ |
{ |
878 |
/* Store the multibyte form of C at BUF. */ |
if (! char_charset (c, charset_list, NULL)) |
879 |
buf += CHAR_STRING (c, buf); |
{ |
880 |
nchars++; |
/* C is not encodable. */ |
881 |
|
int i; |
882 |
|
|
883 |
|
for (i = CHAR_WIDTH (c) - 1; i >= 0; i--, nchars++) |
884 |
|
*buf++ = '?'; |
885 |
|
} |
886 |
|
else |
887 |
|
{ |
888 |
|
/* Store the multibyte form of C at BUF. */ |
889 |
|
buf += CHAR_STRING (c, buf); |
890 |
|
nchars++; |
891 |
|
} |
892 |
} |
} |
893 |
else |
else |
894 |
{ |
{ |
909 |
encode_coding_object (coding, Qnil, 0, 0, nchars, |
encode_coding_object (coding, Qnil, 0, 0, nchars, |
910 |
buf - workbuf, Qnil); |
buf - workbuf, Qnil); |
911 |
} |
} |
912 |
|
/* coding->destination may have been reallocated. */ |
913 |
terminal_encode_buffer = coding->destination; |
terminal_encode_buffer = coding->destination; |
914 |
terminal_encode_buf_size = coding->dst_bytes; |
if (terminal_encode_buf_size < coding->dst_bytes) |
915 |
|
terminal_encode_buf_size = coding->dst_bytes; |
916 |
|
|
917 |
*consumed = src - src_start; |
*consumed = src - src_start; |
918 |
return (coding->produced); |
return (coding->produced); |
1697 |
it->pixel_width = nspaces; |
it->pixel_width = nspaces; |
1698 |
it->nglyphs = nspaces; |
it->nglyphs = nspaces; |
1699 |
} |
} |
1700 |
else if (SINGLE_BYTE_CHAR_P (it->c)) |
else if (CHAR_BYTE8_P (it->c)) |
1701 |
{ |
{ |
1702 |
/* Coming here means that it->c is from display table, thus we |
/* We must send the raw 8-bit byte as is to the terminal. |
1703 |
must send the code as is to the terminal. Although there's |
Although there's no way to know how many columns it occupies |
1704 |
no way to know how many columns it occupies on a screen, it |
on a screen, it is a good assumption that a single byte code |
1705 |
is a good assumption that a single byte code has 1-column |
has 1-column width. */ |
|
width. */ |
|
1706 |
it->pixel_width = it->nglyphs = 1; |
it->pixel_width = it->nglyphs = 1; |
1707 |
if (it->glyph_row) |
if (it->glyph_row) |
1708 |
append_glyph (it); |
append_glyph (it); |