diff src/w32term.c @ 111526:5c986eef8f0d

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.
author Eli Zaretskii <eliz@gnu.org>
date Sat, 13 Nov 2010 15:29:31 +0200
parents d53ee71e7e89
children 22fafcf25a54
line wrap: on
line diff
--- a/src/w32term.c	Sat Nov 13 11:42:32 2010 +0100
+++ b/src/w32term.c	Sat Nov 13 15:29:31 2010 +0200
@@ -1440,7 +1440,7 @@
 		str = (char *) SDATA (acronym);
 	    }
 	}
-      else if (glyph->u.glyphless.method == GLYPHLESS_DISPLAY_HEXA_CODE)
+      else if (glyph->u.glyphless.method == GLYPHLESS_DISPLAY_HEX_CODE)
 	{
 	  sprintf ((char *) buf, "%0*X",
 		   glyph->u.glyphless.ch < 0x10000 ? 4 : 6,
@@ -1448,6 +1448,11 @@
 	  str = buf;
 	}
 
+      if (glyph->u.glyphless.method != GLYPHLESS_DISPLAY_THIN_SPACE)
+	w32_draw_rectangle (s->hdc, s->gc,
+			    x, s->ybase - glyph->ascent,
+			    glyph->pixel_width - 1,
+			    glyph->ascent + glyph->descent - 1);
       if (str)
 	{
 	  struct font *font = s->font;
@@ -1456,7 +1461,7 @@
 	  HFONT old_font;
 
 	  old_font = SelectObject (s->hdc, FONT_HANDLE (font));
-	  /* It is assured that all LEN characters in STR is ASCII.  */
+	  /* It is certain that all LEN characters in STR are ASCII.  */
 	  for (j = 0; j < len; j++)
 	    {
 	      code = font->driver->encode_char (font, str[j]);
@@ -1472,11 +1477,6 @@
 			      with_background);
 	  SelectObject (s->hdc, old_font);
 	}
-      if (glyph->u.glyphless.method != GLYPHLESS_DISPLAY_THIN_SPACE)
-	w32_draw_rectangle (s->hdc, s->gc,
-			    x, s->ybase - glyph->ascent,
-			    glyph->pixel_width - 1,
-			    glyph->ascent + glyph->descent - 1);
       x += glyph->pixel_width;
    }
 }