X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/a0b5606ec769968b10c765f8ff50f312d691ef62..51caf50203be08ba6f15e0d72b777f036d6bee72:/src/font.c diff --git a/src/font.c b/src/font.c index 6a8262623d..ad604ebe74 100644 --- a/src/font.c +++ b/src/font.c @@ -2591,7 +2591,7 @@ font_clear_cache (struct frame *f, Lisp_Object cache, struct font_driver *driver if (! NILP (AREF (val, FONT_TYPE_INDEX))) { eassert (font && driver == font->driver); - driver->close (f, font); + driver->close (font); } } if (driver->free_entity) @@ -2718,7 +2718,7 @@ font_list_entities (struct frame *f, Lisp_Object spec) 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))) { @@ -2861,19 +2861,19 @@ font_open_entity (struct frame *f, Lisp_Object entity, int pixel_size) : 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 @@ -2892,10 +2892,10 @@ font_close_object (struct frame *f, Lisp_Object font_object) /* 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 } @@ -3379,9 +3379,11 @@ register_font_driver (struct font_driver *driver, struct frame *f) 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)) @@ -3667,10 +3669,10 @@ font_at (int c, ptrdiff_t pos, struct face *face, struct window *w, 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); } @@ -3714,7 +3716,7 @@ font_range (ptrdiff_t pos, ptrdiff_t pos_byte, ptrdiff_t *limit, { 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); } @@ -5195,9 +5197,6 @@ EMACS_FONT_LOG is set. Otherwise, it is set to t. */); #ifdef HAVE_NTGUI syms_of_w32font (); #endif /* HAVE_NTGUI */ -#ifdef HAVE_NS - syms_of_nsfont (); -#endif /* HAVE_NS */ #endif /* HAVE_WINDOW_SYSTEM */ }