[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/w32font.c,v
From: |
Jason Rumney |
Subject: |
[Emacs-diffs] Changes to emacs/src/w32font.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: w32font.c
===================================================================
RCS file: /sources/emacs/emacs/src/w32font.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -b -r1.42 -r1.43
--- w32font.c 26 Jun 2008 10:48:27 -0000 1.42
+++ w32font.c 26 Jun 2008 22:11:25 -0000 1.43
@@ -233,8 +233,23 @@
FRAME_PTR f;
struct font *font;
{
+ int i;
struct w32font_info *w32_font = (struct w32font_info *) font;
+
+ /* Delete the GDI font object. */
DeleteObject (w32_font->hfont);
+
+ /* Free all the cached metrics. */
+ if (w32_font->cached_metrics)
+ {
+ for (i = 0; i < w32_font->n_cache_blocks; i++)
+ {
+ if (w32_font->cached_metrics[i])
+ xfree (w32_font->cached_metrics[i]);
+ }
+ xfree (w32_font->cached_metrics);
+ w32_font->cached_metrics = NULL;
+ }
}
/* w32 implementation of has_char for font backend.
@@ -493,8 +508,7 @@
{
metrics->width = total_width;
metrics->lbearing = 0;
- metrics->rbearing = total_width
- + ((struct w32font_info *) font)->metrics.tmOverhang;
+ metrics->rbearing = total_width + w32_font->metrics.tmOverhang;
}
/* Restore state and release DC. */
@@ -831,15 +845,12 @@
/* We don't know how much space we need for the full name, so start with
96 bytes and go up in steps of 32. */
len = 96;
- name = xmalloc (len);
+ name = alloca (len);
while (name && w32font_full_name (&logfont, font_entity, pixel_size,
name, len) < 0)
{
- char *new = xrealloc (name, len += 32);
-
- if (! new)
- xfree (name);
- name = new;
+ len += 32;
+ name = alloca (len);
}
if (name)
font->props[FONT_FULLNAME_INDEX]
@@ -2048,7 +2059,7 @@
/* Initialize as much of the font details as we can from the current
default font. */
hdc = GetDC (FRAME_W32_WINDOW (f));
- oldobj = SelectObject (hdc, ((struct w32font_info *) FRAME_FONT (f))->hfont);
+ oldobj = SelectObject (hdc, FONT_HANDLE (FRAME_FONT (f)));
GetTextFace (hdc, LF_FACESIZE, lf.lfFaceName);
if (GetTextMetrics (hdc, &tm))
{
- [Emacs-diffs] Changes to emacs/src/w32font.c,v, Jason Rumney, 2008/06/01
- [Emacs-diffs] Changes to emacs/src/w32font.c,v, Kenichi Handa, 2008/06/09
- [Emacs-diffs] Changes to emacs/src/w32font.c,v, Jason Rumney, 2008/06/11
- [Emacs-diffs] Changes to emacs/src/w32font.c,v, Juanma Barranquero, 2008/06/12
- [Emacs-diffs] Changes to emacs/src/w32font.c,v, Jason Rumney, 2008/06/13
- [Emacs-diffs] Changes to emacs/src/w32font.c,v, Jason Rumney, 2008/06/16
- [Emacs-diffs] Changes to emacs/src/w32font.c,v, Jason Rumney, 2008/06/18
- [Emacs-diffs] Changes to emacs/src/w32font.c,v, Jason Rumney, 2008/06/20
- [Emacs-diffs] Changes to emacs/src/w32font.c,v, Jason Rumney, 2008/06/26
- [Emacs-diffs] Changes to emacs/src/w32font.c,v,
Jason Rumney <=
- [Emacs-diffs] Changes to emacs/src/w32font.c,v, Jason Rumney, 2008/06/27