29 |
#include "termchar.h" |
#include "termchar.h" |
30 |
#include "termopts.h" |
#include "termopts.h" |
31 |
#include "lisp.h" |
#include "lisp.h" |
32 |
|
#include "buffer.h" |
33 |
|
#include "character.h" |
34 |
#include "charset.h" |
#include "charset.h" |
35 |
#include "coding.h" |
#include "coding.h" |
36 |
#include "keyboard.h" |
#include "keyboard.h" |
812 |
int len; |
int len; |
813 |
register int tlen = GLYPH_TABLE_LENGTH; |
register int tlen = GLYPH_TABLE_LENGTH; |
814 |
register Lisp_Object *tbase = GLYPH_TABLE_BASE; |
register Lisp_Object *tbase = GLYPH_TABLE_BASE; |
|
int result; |
|
815 |
struct coding_system *coding; |
struct coding_system *coding; |
816 |
|
|
817 |
/* If terminal_coding does any conversion, use it, otherwise use |
/* If terminal_coding does any conversion, use it, otherwise use |
830 |
|
|
831 |
if (g < 0 || g >= tlen) |
if (g < 0 || g >= tlen) |
832 |
{ |
{ |
833 |
/* This glyph doesn't has an entry in Vglyph_table. */ |
/* This glyph doesn't have an entry in Vglyph_table. */ |
834 |
if (! CHAR_VALID_P (src->u.ch, 0)) |
if (! CHAR_VALID_P (src->u.ch, 0)) |
835 |
{ |
{ |
836 |
len = 1; |
len = 1; |
869 |
} |
} |
870 |
} |
} |
871 |
|
|
872 |
result = encode_coding (coding, buf, dst, len, dst_end - dst); |
coding->source = buf; |
873 |
|
coding->destination = dst; |
874 |
|
coding->dst_bytes = dst_end - dst; |
875 |
|
encode_coding_object (coding, Qnil, 0, 0, 1, len, Qnil); |
876 |
len -= coding->consumed; |
len -= coding->consumed; |
877 |
dst += coding->produced; |
dst += coding->produced; |
878 |
if (result == CODING_FINISH_INSUFFICIENT_DST |
if (coding->result == CODING_RESULT_INSUFFICIENT_DST) |
|
|| (result == CODING_FINISH_INSUFFICIENT_SRC |
|
|
&& len > dst_end - dst)) |
|
879 |
/* The remaining output buffer is too short. We must |
/* The remaining output buffer is too short. We must |
880 |
break the loop here without increasing SRC so that the |
break the loop here without increasing SRC so that the |
881 |
next call of this function starts from the same glyph. */ |
next call of this function starts from the same glyph. */ |
979 |
if (CODING_REQUIRE_FLUSHING (&terminal_coding)) |
if (CODING_REQUIRE_FLUSHING (&terminal_coding)) |
980 |
{ |
{ |
981 |
terminal_coding.mode |= CODING_MODE_LAST_BLOCK; |
terminal_coding.mode |= CODING_MODE_LAST_BLOCK; |
982 |
encode_coding (&terminal_coding, "", conversion_buffer, |
terminal_coding.source = (unsigned char *) ""; |
983 |
0, conversion_buffer_size); |
terminal_coding.destination = conversion_buffer; |
984 |
|
terminal_coding.dst_bytes = conversion_buffer_size; |
985 |
|
encode_coding_object (&terminal_coding, Qnil, 0, 0, 0, 0, Qnil); |
986 |
if (terminal_coding.produced > 0) |
if (terminal_coding.produced > 0) |
987 |
{ |
{ |
988 |
fwrite (conversion_buffer, 1, terminal_coding.produced, stdout); |
fwrite (conversion_buffer, 1, terminal_coding.produced, stdout); |
1725 |
} |
} |
1726 |
else |
else |
1727 |
{ |
{ |
1728 |
/* A multi-byte character. The display width is fixed for all |
it->pixel_width = CHAR_WIDTH (it->c); |
|
characters of the set. Some of the glyphs may have to be |
|
|
ignored because they are already displayed in a continued |
|
|
line. */ |
|
|
int charset = CHAR_CHARSET (it->c); |
|
|
|
|
|
it->pixel_width = CHARSET_WIDTH (charset); |
|
1729 |
it->nglyphs = it->pixel_width; |
it->nglyphs = it->pixel_width; |
1730 |
|
|
1731 |
if (it->glyph_row) |
if (it->glyph_row) |