if (! NILP (AREF (val, FONT_TYPE_INDEX)))
{
eassert (font && driver == font->driver);
- driver->close (f, font);
+ driver->close (font);
}
}
if (driver->free_entity)
ASET (scratch_font_spec, FONT_SPACING_INDEX, AREF (spec, FONT_SPACING_INDEX));
ASET (scratch_font_spec, FONT_EXTRA_INDEX, AREF (spec, FONT_EXTRA_INDEX));
- for (i = 0; driver_list; driver_list = driver_list->next)
+ for (; driver_list; driver_list = driver_list->next)
if (driver_list->on
&& (NILP (ftype) || EQ (driver_list->driver->type, ftype)))
{
: 1);
height = (font->height ? font->height : 1);
#ifdef HAVE_WINDOW_SYSTEM
- FRAME_X_DISPLAY_INFO (f)->n_fonts++;
- if (FRAME_X_DISPLAY_INFO (f)->n_fonts == 1)
+ FRAME_DISPLAY_INFO (f)->n_fonts++;
+ if (FRAME_DISPLAY_INFO (f)->n_fonts == 1)
{
FRAME_SMALLEST_CHAR_WIDTH (f) = min_width;
FRAME_SMALLEST_FONT_HEIGHT (f) = height;
- fonts_changed_p = 1;
+ f->fonts_changed = 1;
}
else
{
if (FRAME_SMALLEST_CHAR_WIDTH (f) > min_width)
- FRAME_SMALLEST_CHAR_WIDTH (f) = min_width, fonts_changed_p = 1;
+ FRAME_SMALLEST_CHAR_WIDTH (f) = min_width, f->fonts_changed = 1;
if (FRAME_SMALLEST_FONT_HEIGHT (f) > height)
- FRAME_SMALLEST_FONT_HEIGHT (f) = height, fonts_changed_p = 1;
+ FRAME_SMALLEST_FONT_HEIGHT (f) = height, f->fonts_changed = 1;
}
#endif
/* Already closed. */
return;
FONT_ADD_LOG ("close", font_object, Qnil);
- font->driver->close (f, font);
+ font->driver->close (font);
#ifdef HAVE_WINDOW_SYSTEM
- eassert (FRAME_X_DISPLAY_INFO (f)->n_fonts);
- FRAME_X_DISPLAY_INFO (f)->n_fonts--;
+ eassert (FRAME_DISPLAY_INFO (f)->n_fonts);
+ FRAME_DISPLAY_INFO (f)->n_fonts--;
#endif
}
struct font_driver_list *root = f ? f->font_driver_list : font_driver_list;
struct font_driver_list *prev, *list;
+#ifdef HAVE_WINDOW_SYSTEM
if (f && ! driver->draw)
error ("Unusable font driver for a frame: %s",
SDATA (SYMBOL_NAME (driver->type)));
+#endif /* HAVE_WINDOW_SYSTEM */
for (prev = NULL, list = root; list; prev = list, list = list->next)
if (EQ (list->driver->type, driver->type))
ptrdiff_t endptr;
if (STRINGP (string))
- face_id = face_at_string_position (w, string, pos, 0, -1, -1, &endptr,
+ face_id = face_at_string_position (w, string, pos, 0, &endptr,
DEFAULT_FACE_ID, 0);
else
- face_id = face_at_buffer_position (w, pos, -1, -1, &endptr,
+ face_id = face_at_buffer_position (w, pos, &endptr,
pos + 100, 0, -1);
face = FACE_FROM_ID (f, face_id);
}
{
int face_id;
- face_id = face_at_buffer_position (w, pos, 0, 0, &ignore,
+ face_id = face_at_buffer_position (w, pos, &ignore,
*limit, 0, -1);
face = FACE_FROM_ID (XFRAME (w->frame), face_id);
}
return make_string (name, namelen);
}
+void
+clear_font_cache (struct frame *f)
+{
+ struct font_driver_list *driver_list = f->font_driver_list;
+
+ for (; driver_list; driver_list = driver_list->next)
+ if (driver_list->on)
+ {
+ Lisp_Object val, tmp, cache = driver_list->driver->get_cache (f);
+
+ val = XCDR (cache);
+ while (! NILP (val)
+ && ! EQ (XCAR (XCAR (val)), driver_list->driver->type))
+ val = XCDR (val);
+ eassert (! NILP (val));
+ tmp = XCDR (XCAR (val));
+ if (XINT (XCAR (tmp)) == 0)
+ {
+ font_clear_cache (f, XCAR (val), driver_list->driver);
+ XSETCDR (cache, XCDR (val));
+ }
+ }
+}
+
DEFUN ("clear-font-cache", Fclear_font_cache, Sclear_font_cache, 0, 0, 0,
- doc: /* Clear font cache. */)
+ doc: /* Clear font cache of each frame. */)
(void)
{
Lisp_Object list, frame;
FOR_EACH_FRAME (list, frame)
- {
- struct frame *f = XFRAME (frame);
- struct font_driver_list *driver_list = f->font_driver_list;
-
- for (; driver_list; driver_list = driver_list->next)
- if (driver_list->on)
- {
- Lisp_Object cache = driver_list->driver->get_cache (f);
- Lisp_Object val, tmp;
-
- val = XCDR (cache);
- while (! NILP (val)
- && ! EQ (XCAR (XCAR (val)), driver_list->driver->type))
- val = XCDR (val);
- eassert (! NILP (val));
- tmp = XCDR (XCAR (val));
- if (XINT (XCAR (tmp)) == 0)
- {
- font_clear_cache (f, XCAR (val), driver_list->driver);
- XSETCDR (cache, XCDR (val));
- }
- }
- }
+ clear_font_cache (XFRAME (frame));
return Qnil;
}
#ifdef HAVE_NTGUI
syms_of_w32font ();
#endif /* HAVE_NTGUI */
-#ifdef HAVE_NS
- syms_of_nsfont ();
-#endif /* HAVE_NS */
#endif /* HAVE_WINDOW_SYSTEM */
}