# HG changeset patch # User Jason Rumney # Date 1196469083 0 # Node ID 8eb56b57e4a0fcf1d54d50a98f255f85086da060 # Parent 785637bd05d0d94fc49c69d463d4fb441cb37937 (w32font_draw): Fill background manually. diff -r 785637bd05d0 -r 8eb56b57e4a0 src/w32font.c --- a/src/w32font.c Thu Nov 29 13:00:37 2007 +0000 +++ b/src/w32font.c Sat Dec 01 00:31:23 2007 +0000 @@ -531,25 +531,23 @@ DeleteObject (new_clip); } + /* Using OPAQUE background mode can clear more background than expected + when Cleartype is used. Draw the background manually to avoid this. */ + SetBkMode (s->hdc, TRANSPARENT); if (with_background) { - SetBkColor (s->hdc, s->gc->background); - SetBkMode (s->hdc, OPAQUE); -#if 0 HBRUSH brush; RECT rect; + struct font *font = (struct font *) s->face->font_info; brush = CreateSolidBrush (s->gc->background); rect.left = x; - rect.top = y - ((struct font *) (s->font_info->font))->ascent; + rect.top = y - font->ascent; rect.right = x + s->width; - rect.bottom = y + ((struct font *) (s->font_info->font))->descent; + rect.bottom = y + font->descent; FillRect (s->hdc, &rect, brush); DeleteObject (brush); -#endif } - else - SetBkMode (s->hdc, TRANSPARENT); ExtTextOutW (s->hdc, x, y, options, NULL, s->char2b + from, to - from, NULL);