[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/w32term.c,v
From: |
Jason Rumney |
Subject: |
[Emacs-diffs] Changes to emacs/src/w32term.c,v |
Date: |
Thu, 26 Jun 2008 22:11:27 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Changes by: Jason Rumney <jasonr> 08/06/26 22:11:26
Index: w32term.c
===================================================================
RCS file: /sources/emacs/emacs/src/w32term.c,v
retrieving revision 1.298
retrieving revision 1.299
diff -u -b -r1.298 -r1.299
--- w32term.c 26 Jun 2008 10:48:28 -0000 1.298
+++ w32term.c 26 Jun 2008 22:11:25 -0000 1.299
@@ -1237,8 +1237,6 @@
struct glyph_string *s;
{
int i, x;
- struct w32font_info * w32_font;
- HFONT old_font;
/* If first glyph of S has a left box line, start drawing the text
of S to the right of that box line. */
@@ -1248,21 +1246,10 @@
else
x = s->x;
- if (s->for_overlaps || (s->background_filled_p && s->hl != DRAW_CURSOR)
- || cleartype_active)
- SetBkMode (s->hdc, TRANSPARENT);
- else
- SetBkMode (s->hdc, OPAQUE);
-
SetTextColor (s->hdc, s->gc->foreground);
SetBkColor (s->hdc, s->gc->background);
SetTextAlign (s->hdc, TA_BASELINE | TA_LEFT);
- w32_font = (struct w32font_info *) s->font;
-
- if (w32_font && w32_font->hfont)
- old_font = SelectObject (s->hdc, w32_font->hfont);
-
/* Draw characters of S as rectangles if S's font could not be
loaded. */
if (s->font_not_found_p)
@@ -1278,24 +1265,27 @@
}
else
{
- int boff = s->font->baseline_offset;
+ struct font *font = s->font;
+ int boff = font->baseline_offset;
int y;
+ HFONT old_font;
+
+ old_font = SelectObject (s->hdc, FONT_HANDLE (font));
- if (s->font->vertical_centering)
- boff = VCENTER_BASELINE_OFFSET (s->font, s->f) - boff;
+ if (font->vertical_centering)
+ boff = VCENTER_BASELINE_OFFSET (font, s->f) - boff;
y = s->ybase - boff;
if (s->for_overlaps
|| (s->background_filled_p && s->hl != DRAW_CURSOR))
- s->font->driver->draw (s, 0, s->nchars, x, y, 0);
+ font->driver->draw (s, 0, s->nchars, x, y, 0);
else
- s->font->driver->draw (s, 0, s->nchars, x, y, 1);
+ font->driver->draw (s, 0, s->nchars, x, y, 1);
if (s->face->overstrike)
- s->font->driver->draw (s, 0, s->nchars, x + 1, y, 0);
- }
+ font->driver->draw (s, 0, s->nchars, x + 1, y, 0);
- if (w32_font && w32_font->hfont)
SelectObject (s->hdc, old_font);
+ }
}
/* Draw the foreground of composite glyph string S. */
@@ -1305,8 +1295,6 @@
struct glyph_string *s;
{
int i, j, x;
- HFONT old_font;
- struct w32font_info * w32_font;
/* If first glyph of S has a left box line, start drawing the text
of S to the right of that box line. */
@@ -1323,14 +1311,8 @@
SetTextColor (s->hdc, s->gc->foreground);
SetBkColor (s->hdc, s->gc->background);
- SetBkMode (s->hdc, TRANSPARENT);
SetTextAlign (s->hdc, TA_BASELINE | TA_LEFT);
- w32_font = (struct w32font_info *) s->font;
-
- if (w32_font && w32_font->hfont)
- old_font = SelectObject (s->hdc, w32_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)
@@ -1339,11 +1321,14 @@
w32_draw_rectangle (s->hdc, s->gc, x, s->y, s->width - 1,
s->height - 1);
}
-
+ else
{
struct font *font = s->font;
int y = s->ybase;
int width = 0;
+ HFONT old_font;
+
+ old_font = SelectObject (s->hdc, FONT_HANDLE (font));
if (s->cmp->method == COMPOSITION_WITH_GLYPH_STRING)
{
@@ -1393,10 +1378,8 @@
font->driver->draw (s, j, j + 1, xx + 1, yy, 0);
}
}
- }
-
- if (w32_font && w32_font->hfont)
SelectObject (s->hdc, old_font);
+ }
}
@@ -2345,7 +2328,7 @@
/* Draw strike-through. */
if (s->face->strike_through_p
- && !((struct w32font_info *) s->font)->metrics.tmStruckOut)
+ && !FONT_TEXTMETRIC(s->font).tmStruckOut)
{
unsigned long h = 1;
unsigned long dy = (s->height - h) / 2;
- [Emacs-diffs] Changes to emacs/src/w32term.c,v, Jason Rumney, 2008/06/09
- [Emacs-diffs] Changes to emacs/src/w32term.c,v, Stefan Monnier, 2008/06/10
- [Emacs-diffs] Changes to emacs/src/w32term.c,v, Jason Rumney, 2008/06/20
- [Emacs-diffs] Changes to emacs/src/w32term.c,v, Jason Rumney, 2008/06/23
- [Emacs-diffs] Changes to emacs/src/w32term.c,v, Jason Rumney, 2008/06/26
- [Emacs-diffs] Changes to emacs/src/w32term.c,v,
Jason Rumney <=
- [Emacs-diffs] Changes to emacs/src/w32term.c,v, Glenn Morris, 2008/06/27
- [Emacs-diffs] Changes to emacs/src/w32term.c,v, Jason Rumney, 2008/06/28
- [Emacs-diffs] Changes to emacs/src/w32term.c,v, Jason Rumney, 2008/06/29