+2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
+
+ * nsfont.m (Vfonts_in_cache): New variable.
+ (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
+ are used. Add cached fonts to Vfonts_in_cache.
+ (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
+
2012-10-08 Juanma Barranquero <lekktu@gmail.com>
* makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
extern int ns_tmp_flags;
extern struct nsfont_info *ns_tmp_font;
+static Lisp_Object Vfonts_in_cache;
+
+
/* font glyph and metrics caching functions, implemented at end */
static void ns_uni_to_glyphs (struct nsfont_info *font_info,
unsigned char block);
{
if (NSFONT_TRACE)
fprintf(stderr, "*** nsfont_open CACHE HIT!\n");
- /* FIXME: Cast from (unsigned long) to Lisp_Object. */
- XHASH (font_object) = [cached unsignedLongValue];
+ XHASH (font_object) = [cached unsignedLongLongValue];
return font_object;
}
else
font_object = font_make_object (VECSIZE (struct nsfont_info),
font_entity, pixel_size);
if (!synthItal)
- [fontCache setObject: [NSNumber numberWithUnsignedLong:
- (unsigned long) XHASH (font_object)]
- forKey: nsfont];
+ {
+ [fontCache setObject: [NSNumber
+ numberWithUnsignedLongLong:
+ (unsigned long long) XHASH (font_object)]
+ forKey: nsfont];
+ Vfonts_in_cache = Fcons (font_object, Vfonts_in_cache);
+ }
}
font_info = (struct nsfont_info *) XFONT_OBJECT (font_object);
doc: /* Internal use: maps font registry to Unicode script. */);
ascii_printable = NULL;
+
+ Vfonts_in_cache = Qnil;
+ staticpro (&Vfonts_in_cache);
}