comparison src/w32font.c @ 91128:8eb56b57e4a0

(w32font_draw): Fill background manually.
author Jason Rumney <jasonr@gnu.org>
date Sat, 01 Dec 2007 00:31:23 +0000
parents b656aee8436b
children 5e7347695108
comparison
equal deleted inserted replaced
91127:785637bd05d0 91128:8eb56b57e4a0
529 529
530 SelectClipRgn (s->hdc, new_clip); 530 SelectClipRgn (s->hdc, new_clip);
531 DeleteObject (new_clip); 531 DeleteObject (new_clip);
532 } 532 }
533 533
534 /* Using OPAQUE background mode can clear more background than expected
535 when Cleartype is used. Draw the background manually to avoid this. */
536 SetBkMode (s->hdc, TRANSPARENT);
534 if (with_background) 537 if (with_background)
535 { 538 {
536 SetBkColor (s->hdc, s->gc->background);
537 SetBkMode (s->hdc, OPAQUE);
538 #if 0
539 HBRUSH brush; 539 HBRUSH brush;
540 RECT rect; 540 RECT rect;
541 struct font *font = (struct font *) s->face->font_info;
541 542
542 brush = CreateSolidBrush (s->gc->background); 543 brush = CreateSolidBrush (s->gc->background);
543 rect.left = x; 544 rect.left = x;
544 rect.top = y - ((struct font *) (s->font_info->font))->ascent; 545 rect.top = y - font->ascent;
545 rect.right = x + s->width; 546 rect.right = x + s->width;
546 rect.bottom = y + ((struct font *) (s->font_info->font))->descent; 547 rect.bottom = y + font->descent;
547 FillRect (s->hdc, &rect, brush); 548 FillRect (s->hdc, &rect, brush);
548 DeleteObject (brush); 549 DeleteObject (brush);
549 #endif 550 }
550 }
551 else
552 SetBkMode (s->hdc, TRANSPARENT);
553 551
554 ExtTextOutW (s->hdc, x, y, options, NULL, s->char2b + from, to - from, NULL); 552 ExtTextOutW (s->hdc, x, y, options, NULL, s->char2b + from, to - from, NULL);
555 553
556 /* Restore clip region. */ 554 /* Restore clip region. */
557 if (s->num_clips > 0) 555 if (s->num_clips > 0)