changeset 80663:d712a21c7c2a

(x_draw_composite_glyph_string_foreground): Force use of Unicode output.
author Jason Rumney <jasonr@gnu.org>
date Fri, 01 Aug 2008 15:10:50 +0000
parents 11132aa5cccf
children 4aa666fb6103
files src/ChangeLog src/w32term.c
diffstat 2 files changed, 15 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Thu Jul 31 21:12:21 2008 +0000
+++ b/src/ChangeLog	Fri Aug 01 15:10:50 2008 +0000
@@ -1,3 +1,8 @@
+2008-08-01  Jason Rumney  <jasonr@gnu.org>
+
+        * w32term.c (x_draw_composite_glyph_string_foreground): Force
+        use of Unicode output.
+
 2008-07-30  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
 
 	* xmenu.c (Fx_menu_bar_open_internal): Use activate_item signal to
--- a/src/w32term.c	Thu Jul 31 21:12:21 2008 +0000
+++ b/src/w32term.c	Fri Aug 01 15:10:50 2008 +0000
@@ -1631,9 +1631,6 @@
   SetBkMode (s->hdc, TRANSPARENT);
   SetTextAlign (s->hdc, TA_BASELINE | TA_LEFT);
 
-  if (s->font && s->font->hfont)
-    old_font = SelectObject (s->hdc, s->font->hfont);
-
   /* Draw a rectangle for the composition if the font for the very
      first character of the composition could not be loaded.  */
   if (s->font_not_found_p)
@@ -1644,6 +1641,13 @@
     }
   else
     {
+      if (s->font && s->font->hfont)
+        old_font = SelectObject (s->hdc, s->font->hfont);
+
+      /* Because of the way Emacs encodes composite glyphs, the font_type
+         may not be set up yet.  Always use unicode for composite glyphs.  */
+      s->first_glyph->font_type = UNICODE_FONT;
+
       for (i = 0; i < s->nchars; i++, ++s->gidx)
 	{
 	  w32_text_out (s, x + s->cmp->offsets[s->gidx * 2],
@@ -1654,10 +1658,10 @@
 			  s->ybase - s->cmp->offsets[s->gidx * 2 + 1],
 			  s->char2b + i, 1);
 	}
+
+      if (s->font && s->font->hfont)
+        SelectObject (s->hdc, old_font);
     }
-
-  if (s->font && s->font->hfont)
-    SelectObject (s->hdc, old_font);
 }