aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2010-11-13 15:29:31 +0200
committerEli Zaretskii2010-11-13 15:29:31 +0200
commit0eb025fb55277c038c39e7325a556de46ecbd2e4 (patch)
tree677650021eae4915030d38baabe6c872eaa31845 /src
parent6e060cee8186d9fe5ad5f8a783d45f80f9b1bbe3 (diff)
downloademacs-0eb025fb55277c038c39e7325a556de46ecbd2e4.tar.gz
emacs-0eb025fb55277c038c39e7325a556de46ecbd2e4.zip
Fix and document display of glyphless characters.
src/xdisp.c (set_cursor_from_row): Fix cursor positioning on zero-width characters. (syms_of_xdisp) <glyphless-char-display>: Doc fix. src/.gdbinit (pgx): Adapt to latest changes in `struct glyph'. src/w32term.c (x_draw_glyphless_glyph_string_foreground): Draw the box before drawing the glyphs inside it. src/dispextern.h (enum glyphless_display_method): Rename GLYPHLESS_DISPLAY_HEXA_CODE to GLYPHLESS_DISPLAY_HEX_CODE. All users changed. src/term.c (append_glyphless_glyph, produce_glyphless_glyph): Fix comments. (produce_glyphless_glyph): Enclose "U+nnnn" and "empty box" whitespace in "[]", to simulate a box. Don't use uninitialized variable `width'. lisp/international/characters.el (glyphless-char-display-control): Renamed from glyphless-char-control; all users changed. Doc fix. Signal an error if display method is not one of the recognized symbols. doc/emacs/rmail.texi (Rmail Coding): Characters with no fonts are not necessarily displayed as empty boxes. doc/emacs/mule.texi (Language Environments, Fontsets): Characters with no fonts are not necessarily displayed as empty boxes. doc/emacs/display.texi (Text Display): Document display of glyphless characters. doc/lispref/display.texi (Usual Display): Characters with no fonts are not necessarily displayed as empty boxes. etc/NEWS: Document display of glyphless characters.
Diffstat (limited to 'src')
-rw-r--r--src/.gdbinit26
-rw-r--r--src/ChangeLog22
-rw-r--r--src/dispextern.h14
-rw-r--r--src/term.c33
-rw-r--r--src/w32term.c14
-rw-r--r--src/xdisp.c28
-rw-r--r--src/xterm.c2
7 files changed, 90 insertions, 49 deletions
diff --git a/src/.gdbinit b/src/.gdbinit
index b3bb6b58267..73fecea5972 100644
--- a/src/.gdbinit
+++ b/src/.gdbinit
@@ -494,14 +494,30 @@ define pgx
494 end 494 end
495 # COMPOSITE_GLYPH 495 # COMPOSITE_GLYPH
496 if ($g->type == 1) 496 if ($g->type == 1)
497 printf "COMP[%d (%d..%d)]", $g->u.cmp.id, $g->u.cmp.from, $g->u.cmp.to 497 printf "COMP[%d (%d..%d)]", $g->u.cmp.id, $g->slice.cmp.from, $g->slice.cmp.to
498 end 498 end
499 # IMAGE_GLYPH 499 # GLYPHLESS_GLYPH
500 if ($g->type == 2) 500 if ($g->type == 2)
501 printf "GLYPHLESS["
502 if ($g->u.glyphless.method == 0)
503 printf "THIN]"
504 end
505 if ($g->u.glyphless.method == 1)
506 printf "EMPTY]"
507 end
508 if ($g->u.glyphless.method == 2)
509 printf "ACRO]"
510 end
511 if ($g->u.glyphless.method == 3)
512 printf "HEX]"
513 end
514 end
515 # IMAGE_GLYPH
516 if ($g->type == 3)
501 printf "IMAGE[%d]", $g->u.img_id 517 printf "IMAGE[%d]", $g->u.img_id
502 end 518 end
503 # STRETCH_GLYPH 519 # STRETCH_GLYPH
504 if ($g->type == 3) 520 if ($g->type == 4)
505 printf "STRETCH[%d+%d]", $g->u.stretch.height, $g->u.stretch.ascent 521 printf "STRETCH[%d+%d]", $g->u.stretch.height, $g->u.stretch.ascent
506 end 522 end
507 xgettype ($g->object) 523 xgettype ($g->object)
@@ -544,8 +560,8 @@ define pgx
544 if ($g->right_box_line_p) 560 if ($g->right_box_line_p)
545 printf " ]" 561 printf " ]"
546 end 562 end
547 if ($g->slice.x || $g->slice.y || $g->slice.width || $g->slice.height) 563 if ($g->slice.img.x || $g->slice.img.y || $g->slice.img.width || $g->slice.img.height)
548 printf " slice=%d,%d,%d,%d" ,$g->slice.x, $g->slice.y, $g->slice.width, $g->slice.height 564 printf " slice=%d,%d,%d,%d" ,$g->slice.img.x, $g->slice.img.y, $g->slice.img.width, $g->slice.img.height
549 end 565 end
550 printf "\n" 566 printf "\n"
551end 567end
diff --git a/src/ChangeLog b/src/ChangeLog
index 13f90d12790..2bac819c0d5 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,25 @@
12010-11-13 Eli Zaretskii <eliz@gnu.org>
2
3 * xdisp.c (set_cursor_from_row): Fix cursor positioning on
4 zero-width characters.
5
6 * .gdbinit (pgx): Adapt to latest changes in `struct glyph'.
7
8 * w32term.c (x_draw_glyphless_glyph_string_foreground): Draw the
9 box before drawing the glyphs inside it.
10
11 * xdisp.c (syms_of_xdisp) <glyphless-char-display>: Doc fix.
12
13 * dispextern.h (enum glyphless_display_method): Rename
14 GLYPHLESS_DISPLAY_HEXA_CODE to GLYPHLESS_DISPLAY_HEX_CODE. All
15 users changed.
16
17 * term.c (append_glyphless_glyph, produce_glyphless_glyph): Fix
18 comments.
19 (produce_glyphless_glyph): Enclose "U+nnnn" and "empty box"
20 whitespace in "[]", to simulate a box. Don't use uninitialized
21 variable `width'.
22
12010-11-11 Julien Danjou <julien@danjou.info> 232010-11-11 Julien Danjou <julien@danjou.info>
2 24
3 * xsettings.c (init_xsettings): Use already fetch atoms. 25 * xsettings.c (init_xsettings): Use already fetch atoms.
diff --git a/src/dispextern.h b/src/dispextern.h
index 30bd051b0ac..0786fff67cc 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -371,12 +371,11 @@ struct glyph
371 displaying. The member `pixel_width' above is set to 1. */ 371 displaying. The member `pixel_width' above is set to 1. */
372 unsigned padding_p : 1; 372 unsigned padding_p : 1;
373 373
374 /* 1 means the actual glyph is not available, draw a box instead. 374 /* 1 means the actual glyph is not available, draw using `struct
375 This can happen when a font couldn't be loaded, or a character 375 glyphless' below instead. This can happen when a font couldn't
376 doesn't have a glyph in a font. */ 376 be loaded, or a character doesn't have a glyph in a font. */
377 unsigned glyph_not_available_p : 1; 377 unsigned glyph_not_available_p : 1;
378 378
379
380 /* Non-zero means don't display cursor here. */ 379 /* Non-zero means don't display cursor here. */
381 unsigned avoid_cursor_p : 1; 380 unsigned avoid_cursor_p : 1;
382 381
@@ -1997,14 +1996,15 @@ enum line_wrap_method
1997 1996
1998enum glyphless_display_method 1997enum glyphless_display_method
1999 { 1998 {
2000 /* Display a thin (1-pixel width) space. */ 1999 /* Display a thin (1-pixel width) space. On a TTY, display a
2000 1-character width space. */
2001 GLYPHLESS_DISPLAY_THIN_SPACE, 2001 GLYPHLESS_DISPLAY_THIN_SPACE,
2002 /* Display an empty box of proper width. */ 2002 /* Display an empty box of proper width. */
2003 GLYPHLESS_DISPLAY_EMPTY_BOX, 2003 GLYPHLESS_DISPLAY_EMPTY_BOX,
2004 /* Display an acronym string in a box. */ 2004 /* Display an acronym string in a box. */
2005 GLYPHLESS_DISPLAY_ACRONYM, 2005 GLYPHLESS_DISPLAY_ACRONYM,
2006 /* Display a hexadecimal character code in a box. */ 2006 /* Display the hexadecimal code of the character in a box. */
2007 GLYPHLESS_DISPLAY_HEXA_CODE 2007 GLYPHLESS_DISPLAY_HEX_CODE
2008 }; 2008 };
2009 2009
2010struct it_slice 2010struct it_slice
diff --git a/src/term.c b/src/term.c
index dbbdc03f190..71df92822ac 100644
--- a/src/term.c
+++ b/src/term.c
@@ -1850,9 +1850,9 @@ produce_composite_glyph (struct it *it)
1850 1850
1851 1851
1852/* Append a glyph for a glyphless character to IT->glyph_row. FACE_ID 1852/* Append a glyph for a glyphless character to IT->glyph_row. FACE_ID
1853 is a face ID to be used for the glyph. What actually appended are 1853 is a face ID to be used for the glyph. What is actually appended
1854 glyphs of type CHAR_GLYPH of which characters are in STR 1854 are glyphs of type CHAR_GLYPH whose characters are in STR (which
1855 (it->nglyphs bytes). */ 1855 comes from it->nglyphs bytes). */
1856 1856
1857static void 1857static void
1858append_glyphless_glyph (struct it *it, int face_id, char *str) 1858append_glyphless_glyph (struct it *it, int face_id, char *str)
@@ -1923,7 +1923,7 @@ extern Lisp_Object Qglyphless_char;
1923/* Produce glyphs for a glyphless character for iterator IT. 1923/* Produce glyphs for a glyphless character for iterator IT.
1924 IT->glyphless_method specifies which method to use for displaying 1924 IT->glyphless_method specifies which method to use for displaying
1925 the character. See the description of enum 1925 the character. See the description of enum
1926 glyphless_display_method in dispextern.h for the detail. 1926 glyphless_display_method in dispextern.h for the details.
1927 1927
1928 FOR_NO_FONT is nonzero if and only if this is for a character that 1928 FOR_NO_FONT is nonzero if and only if this is for a character that
1929 is not supproted by the coding system of the terminal. ACRONYM, if 1929 is not supproted by the coding system of the terminal. ACRONYM, if
@@ -1935,11 +1935,11 @@ static void
1935produce_glyphless_glyph (struct it *it, int for_no_font, Lisp_Object acronym) 1935produce_glyphless_glyph (struct it *it, int for_no_font, Lisp_Object acronym)
1936{ 1936{
1937 int face_id; 1937 int face_id;
1938 int width, len; 1938 int len;
1939 char buf[9], *str = " "; 1939 char buf[11], *str = " ";
1940 1940
1941 /* Get a face ID for the glyph by utilizing a cache (the same way as 1941 /* Get a face ID for the glyph by utilizing a cache (the same way as
1942 doen for `escape-glyph' in get_next_display_element). */ 1942 done for `escape-glyph' in get_next_display_element). */
1943 if (it->f == last_glyphless_glyph_frame 1943 if (it->f == last_glyphless_glyph_frame
1944 && it->face_id == last_glyphless_glyph_face_id) 1944 && it->face_id == last_glyphless_glyph_face_id)
1945 { 1945 {
@@ -1956,8 +1956,8 @@ produce_glyphless_glyph (struct it *it, int for_no_font, Lisp_Object acronym)
1956 1956
1957 if (it->glyphless_method == GLYPHLESS_DISPLAY_THIN_SPACE) 1957 if (it->glyphless_method == GLYPHLESS_DISPLAY_THIN_SPACE)
1958 { 1958 {
1959 /* As there's no way to produce a thin space, we produce 1959 /* As there's no way to produce a thin space, we produce a space
1960 a space of canonical width.. */ 1960 of canonical width. */
1961 len = 1; 1961 len = 1;
1962 } 1962 }
1963 else if (it->glyphless_method == GLYPHLESS_DISPLAY_EMPTY_BOX) 1963 else if (it->glyphless_method == GLYPHLESS_DISPLAY_EMPTY_BOX)
@@ -1965,8 +1965,11 @@ produce_glyphless_glyph (struct it *it, int for_no_font, Lisp_Object acronym)
1965 len = CHAR_WIDTH (it->c); 1965 len = CHAR_WIDTH (it->c);
1966 if (len == 0) 1966 if (len == 0)
1967 len = 1; 1967 len = 1;
1968 else if (width > 4) 1968 else if (len > 4)
1969 len = 4; 1969 len = 4;
1970 sprintf (buf, "[%.*s]", len, str);
1971 len += 2;
1972 str = buf;
1970 } 1973 }
1971 else 1974 else
1972 { 1975 {
@@ -1983,11 +1986,11 @@ produce_glyphless_glyph (struct it *it, int for_no_font, Lisp_Object acronym)
1983 } 1986 }
1984 else 1987 else
1985 { 1988 {
1986 xassert (it->glyphless_method == GLYPHLESS_DISPLAY_HEXA_CODE); 1989 xassert (it->glyphless_method == GLYPHLESS_DISPLAY_HEX_CODE);
1987 len = (it->c < 0x100 ? sprintf (buf, "U+%02X", it->c) 1990 len = (it->c < 0x100 ? sprintf (buf, "[U+%02X]", it->c)
1988 : it->c < 0x10000 ? sprintf (buf, "U+%04X", it->c) 1991 : it->c < 0x10000 ? sprintf (buf, "[U+%04X]", it->c)
1989 : it->c <= MAX_UNICODE_CHAR ? sprintf (buf, "U+%06X", it->c) 1992 : it->c <= MAX_UNICODE_CHAR ? sprintf (buf, "[U+%06X]", it->c)
1990 : sprintf (buf, "E+%06X", it->c)); 1993 : sprintf (buf, "[E+%06X]", it->c));
1991 } 1994 }
1992 str = buf; 1995 str = buf;
1993 } 1996 }
diff --git a/src/w32term.c b/src/w32term.c
index a93bc064c39..33b60c568c0 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -1440,7 +1440,7 @@ x_draw_glyphless_glyph_string_foreground (struct glyph_string *s)
1440 str = (char *) SDATA (acronym); 1440 str = (char *) SDATA (acronym);
1441 } 1441 }
1442 } 1442 }
1443 else if (glyph->u.glyphless.method == GLYPHLESS_DISPLAY_HEXA_CODE) 1443 else if (glyph->u.glyphless.method == GLYPHLESS_DISPLAY_HEX_CODE)
1444 { 1444 {
1445 sprintf ((char *) buf, "%0*X", 1445 sprintf ((char *) buf, "%0*X",
1446 glyph->u.glyphless.ch < 0x10000 ? 4 : 6, 1446 glyph->u.glyphless.ch < 0x10000 ? 4 : 6,
@@ -1448,6 +1448,11 @@ x_draw_glyphless_glyph_string_foreground (struct glyph_string *s)
1448 str = buf; 1448 str = buf;
1449 } 1449 }
1450 1450
1451 if (glyph->u.glyphless.method != GLYPHLESS_DISPLAY_THIN_SPACE)
1452 w32_draw_rectangle (s->hdc, s->gc,
1453 x, s->ybase - glyph->ascent,
1454 glyph->pixel_width - 1,
1455 glyph->ascent + glyph->descent - 1);
1451 if (str) 1456 if (str)
1452 { 1457 {
1453 struct font *font = s->font; 1458 struct font *font = s->font;
@@ -1456,7 +1461,7 @@ x_draw_glyphless_glyph_string_foreground (struct glyph_string *s)
1456 HFONT old_font; 1461 HFONT old_font;
1457 1462
1458 old_font = SelectObject (s->hdc, FONT_HANDLE (font)); 1463 old_font = SelectObject (s->hdc, FONT_HANDLE (font));
1459 /* It is assured that all LEN characters in STR is ASCII. */ 1464 /* It is certain that all LEN characters in STR are ASCII. */
1460 for (j = 0; j < len; j++) 1465 for (j = 0; j < len; j++)
1461 { 1466 {
1462 code = font->driver->encode_char (font, str[j]); 1467 code = font->driver->encode_char (font, str[j]);
@@ -1472,11 +1477,6 @@ x_draw_glyphless_glyph_string_foreground (struct glyph_string *s)
1472 with_background); 1477 with_background);
1473 SelectObject (s->hdc, old_font); 1478 SelectObject (s->hdc, old_font);
1474 } 1479 }
1475 if (glyph->u.glyphless.method != GLYPHLESS_DISPLAY_THIN_SPACE)
1476 w32_draw_rectangle (s->hdc, s->gc,
1477 x, s->ybase - glyph->ascent,
1478 glyph->pixel_width - 1,
1479 glyph->ascent + glyph->descent - 1);
1480 x += glyph->pixel_width; 1480 x += glyph->pixel_width;
1481 } 1481 }
1482} 1482}
diff --git a/src/xdisp.c b/src/xdisp.c
index 928a37a2b50..21c89088383 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -971,7 +971,7 @@ Lisp_Object Vglyphless_char_display;
971Lisp_Object Qglyphless_char_display; 971Lisp_Object Qglyphless_char_display;
972 972
973/* Method symbols for Vglyphless_char_display. */ 973/* Method symbols for Vglyphless_char_display. */
974static Lisp_Object Qhexa_code, Qempty_box, Qthin_space, Qzero_width; 974static Lisp_Object Qhex_code, Qempty_box, Qthin_space, Qzero_width;
975 975
976/* Default pixel width of `thin-space' display method. */ 976/* Default pixel width of `thin-space' display method. */
977#define THIN_SPACE_WIDTH 1 977#define THIN_SPACE_WIDTH 1
@@ -5813,8 +5813,8 @@ lookup_glyphless_char_display (int c, struct it *it)
5813 it->glyphless_method = GLYPHLESS_DISPLAY_THIN_SPACE; 5813 it->glyphless_method = GLYPHLESS_DISPLAY_THIN_SPACE;
5814 else if (EQ (glyphless_method, Qempty_box)) 5814 else if (EQ (glyphless_method, Qempty_box))
5815 it->glyphless_method = GLYPHLESS_DISPLAY_EMPTY_BOX; 5815 it->glyphless_method = GLYPHLESS_DISPLAY_EMPTY_BOX;
5816 else if (EQ (glyphless_method, Qhexa_code)) 5816 else if (EQ (glyphless_method, Qhex_code))
5817 it->glyphless_method = GLYPHLESS_DISPLAY_HEXA_CODE; 5817 it->glyphless_method = GLYPHLESS_DISPLAY_HEX_CODE;
5818 else if (STRINGP (glyphless_method)) 5818 else if (STRINGP (glyphless_method))
5819 it->glyphless_method = GLYPHLESS_DISPLAY_ACRONYM; 5819 it->glyphless_method = GLYPHLESS_DISPLAY_ACRONYM;
5820 else 5820 else
@@ -12871,10 +12871,10 @@ set_cursor_from_row (struct window *w, struct glyph_row *row,
12871 || (row->truncated_on_left_p && pt_old < bpos_min) 12871 || (row->truncated_on_left_p && pt_old < bpos_min)
12872 || (row->truncated_on_right_p && pt_old > bpos_max) 12872 || (row->truncated_on_right_p && pt_old > bpos_max)
12873 /* Zero-width characters produce no glyphs. */ 12873 /* Zero-width characters produce no glyphs. */
12874 || ((row->reversed_p 12874 || (!string_seen
12875 ? glyph_after > glyphs_end 12875 && (row->reversed_p
12876 : glyph_after < glyphs_end) 12876 ? glyph_after > glyphs_end
12877 && eabs (glyph_after - glyph_before) == 1)) 12877 : glyph_after < glyphs_end)))
12878 { 12878 {
12879 cursor = glyph_after; 12879 cursor = glyph_after;
12880 x = -1; 12880 x = -1;
@@ -22292,7 +22292,7 @@ calc_line_height_property (struct it *it, Lisp_Object val, struct font *font,
22292 and only if this is for a character for which no font was found. 22292 and only if this is for a character for which no font was found.
22293 22293
22294 If the display method (it->glyphless_method) is 22294 If the display method (it->glyphless_method) is
22295 GLYPHLESS_DISPLAY_ACRONYM or GLYPHLESS_DISPLAY_HEXA_CODE, LEN is a 22295 GLYPHLESS_DISPLAY_ACRONYM or GLYPHLESS_DISPLAY_HEX_CODE, LEN is a
22296 length of the acronym or the hexadecimal string, UPPER_XOFF and 22296 length of the acronym or the hexadecimal string, UPPER_XOFF and
22297 UPPER_YOFF are pixel offsets for the upper part of the string, 22297 UPPER_YOFF are pixel offsets for the upper part of the string,
22298 LOWER_XOFF and LOWER_YOFF are for the lower part. 22298 LOWER_XOFF and LOWER_YOFF are for the lower part.
@@ -22441,7 +22441,7 @@ produce_glyphless_glyph (struct it *it, int for_no_font, Lisp_Object acronym)
22441 } 22441 }
22442 else 22442 else
22443 { 22443 {
22444 xassert (it->glyphless_method == GLYPHLESS_DISPLAY_HEXA_CODE); 22444 xassert (it->glyphless_method == GLYPHLESS_DISPLAY_HEX_CODE);
22445 sprintf (buf, "%0*X", it->c < 0x10000 ? 4 : 6, it->c); 22445 sprintf (buf, "%0*X", it->c < 0x10000 ? 4 : 6, it->c);
22446 str = buf; 22446 str = buf;
22447 } 22447 }
@@ -27057,7 +27057,7 @@ cursor shapes. */);
27057 hourglass_shown_p = 0; 27057 hourglass_shown_p = 0;
27058 27058
27059 DEFSYM (Qglyphless_char, "glyphless-char"); 27059 DEFSYM (Qglyphless_char, "glyphless-char");
27060 DEFSYM (Qhexa_code, "hexa-code"); 27060 DEFSYM (Qhex_code, "hex-code");
27061 DEFSYM (Qempty_box, "empty-box"); 27061 DEFSYM (Qempty_box, "empty-box");
27062 DEFSYM (Qthin_space, "thin-space"); 27062 DEFSYM (Qthin_space, "thin-space");
27063 DEFSYM (Qzero_width, "zero-width"); 27063 DEFSYM (Qzero_width, "zero-width");
@@ -27073,13 +27073,13 @@ cursor shapes. */);
27073 doc: /* Char-table to control displaying of glyphless characters. 27073 doc: /* Char-table to control displaying of glyphless characters.
27074Each element, if non-nil, is an ASCII acronym string (displayed in a box) 27074Each element, if non-nil, is an ASCII acronym string (displayed in a box)
27075or one of these symbols: 27075or one of these symbols:
27076 hexa-code: display with hexadecimal character code in a box 27076 hex-code: display the hexadecimal code of a character in a box
27077 empty-box: display with an empty box 27077 empty-box: display as an empty box
27078 thin-space: display with 1-pixel width space 27078 thin-space: display as 1-pixel width space
27079 zero-width: don't display 27079 zero-width: don't display
27080 27080
27081It has one extra slot to control the display of a character for which 27081It has one extra slot to control the display of a character for which
27082no font is found. The value of the slot is `hexa-code' or `empty-box'. 27082no font is found. The value of the slot is `hex-code' or `empty-box'.
27083The default is `empty-box'. */); 27083The default is `empty-box'. */);
27084 Vglyphless_char_display = Fmake_char_table (Qglyphless_char_display, Qnil); 27084 Vglyphless_char_display = Fmake_char_table (Qglyphless_char_display, Qnil);
27085 Fset_char_table_extra_slot (Vglyphless_char_display, make_number (0), 27085 Fset_char_table_extra_slot (Vglyphless_char_display, make_number (0),
diff --git a/src/xterm.c b/src/xterm.c
index e58d072e59f..f8b7b2a630c 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -1369,7 +1369,7 @@ x_draw_glyphless_glyph_string_foreground (struct glyph_string *s)
1369 str = (char *) SDATA (acronym); 1369 str = (char *) SDATA (acronym);
1370 } 1370 }
1371 } 1371 }
1372 else if (glyph->u.glyphless.method == GLYPHLESS_DISPLAY_HEXA_CODE) 1372 else if (glyph->u.glyphless.method == GLYPHLESS_DISPLAY_HEX_CODE)
1373 { 1373 {
1374 sprintf ((char *) buf, "%0*X", 1374 sprintf ((char *) buf, "%0*X",
1375 glyph->u.glyphless.ch < 0x10000 ? 4 : 6, 1375 glyph->u.glyphless.ch < 0x10000 ? 4 : 6,