From cf86e18b159f754d6e5537b7b9cbefc32297f7d2 Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Thu, 12 Dec 2013 18:26:06 +0400 Subject: * font.h (struct font_entity) [HAVE_NS]: New field to record font driver which was used to create this entity. (struct font) [HAVE_WINDOW_SYSTEM]: New field to record frame where the font was opened. (font_close_object): Add prototype. * font.c (font_make_entity) [HAVE_NS]: Zero out driver field. (font_close_object): Not static any more. Lost frame arg. Adjust comment and users. * alloc.c (cleanup_vector): Call font_close_object to adjust per-frame font counters correctly. If HAVE_NS, also call driver-specific cleanup for font-entity objects. * ftfont.c (ftfont_open): * nsfont.m (nsfont_open): * w32font.c (w32font_open_internal): * xfont.c (xfont_open): * xftfont.c (xftfont_open): Save frame pointer in font object. * macfont.m (macfont_open): Likewise. (macfont_descriptor_entity): Save driver pointer to be able to call its free_entity routine when font-entity is swept. * ftxfont.c (ftxfont_open): Add eassert because frame pointer should be saved by ftfont_driver.open. --- src/w32font.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/w32font.c') diff --git a/src/w32font.c b/src/w32font.c index 654e0d9cae4..20469274969 100644 --- a/src/w32font.c +++ b/src/w32font.c @@ -999,6 +999,7 @@ w32font_open_internal (struct frame *f, Lisp_Object font_entity, = DECODE_SYSTEM (build_string (logfont.lfFaceName)); } + font->frame = f; font->max_width = w32_font->metrics.tmMaxCharWidth; /* Parts of Emacs display assume that height = ascent + descent... so height is defined later, after ascent and descent. -- cgit v1.2.3