diff options
| author | Kenichi Handa | 2008-06-16 07:32:48 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2008-06-16 07:32:48 +0000 |
| commit | 5e634ec9b742cc1dedcc552b36a9f3804b5c88b9 (patch) | |
| tree | 7390f3597d6bc14b92bf3ca4095a45d8d60793c2 /src | |
| parent | 6409a9558a4215fa71bb0b7cd358f3c0c24d9a23 (diff) | |
| download | emacs-5e634ec9b742cc1dedcc552b36a9f3804b5c88b9.tar.gz emacs-5e634ec9b742cc1dedcc552b36a9f3804b5c88b9.zip | |
(font_check_object): Delete it.
(font_clear_cache): Check if a font-object is alive.
(font_open_entity): Likewise. Set FONT_OBJLST_INDEX of a
font-object to nil.
(font_close_object): Don't check FONT_CLOSE_OBJECT.
(font_at): Don't call font_check_object.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 9 | ||||
| -rw-r--r-- | src/font.c | 62 |
2 files changed, 26 insertions, 45 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 6567cf00362..2eeb98135eb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2008-06-16 Kenichi Handa <handa@m17n.org> | ||
| 2 | |||
| 3 | * font.c (font_check_object): Delete it. | ||
| 4 | (font_clear_cache): Check if a font-object is alive. | ||
| 5 | (font_open_entity): Likewise. Set FONT_OBJLST_INDEX of a | ||
| 6 | font-object to nil. | ||
| 7 | (font_close_object): Don't check FONT_CLOSE_OBJECT. | ||
| 8 | (font_at): Don't call font_check_object. | ||
| 9 | |||
| 1 | 2008-06-16 Katsumi Yamaoka <yamaoka@jpl.org> | 10 | 2008-06-16 Katsumi Yamaoka <yamaoka@jpl.org> |
| 2 | 11 | ||
| 3 | * puresize.h (BASE_PURESIZE): Increase to 1230000. | 12 | * puresize.h (BASE_PURESIZE): Increase to 1230000. |
diff --git a/src/font.c b/src/font.c index 3d4ab375c96..60c0b4fdcf6 100644 --- a/src/font.c +++ b/src/font.c | |||
| @@ -2427,26 +2427,6 @@ font_match_p (spec, entity) | |||
| 2427 | 2427 | ||
| 2428 | return (font_score (entity, prefer_prop) == 0); | 2428 | return (font_score (entity, prefer_prop) == 0); |
| 2429 | } | 2429 | } |
| 2430 | |||
| 2431 | |||
| 2432 | /* CHeck a lispy font object corresponding to FONT. */ | ||
| 2433 | |||
| 2434 | int | ||
| 2435 | font_check_object (font) | ||
| 2436 | struct font *font; | ||
| 2437 | { | ||
| 2438 | Lisp_Object tail, elt; | ||
| 2439 | |||
| 2440 | for (tail = font->props[FONT_OBJLIST_INDEX]; CONSP (tail); | ||
| 2441 | tail = XCDR (tail)) | ||
| 2442 | { | ||
| 2443 | elt = XCAR (tail); | ||
| 2444 | if (font == XFONT_OBJECT (elt)) | ||
| 2445 | return 1; | ||
| 2446 | } | ||
| 2447 | return 0; | ||
| 2448 | } | ||
| 2449 | |||
| 2450 | 2430 | ||
| 2451 | 2431 | ||
| 2452 | /* Font cache | 2432 | /* Font cache |
| @@ -2563,9 +2543,12 @@ font_clear_cache (f, cache, driver) | |||
| 2563 | Lisp_Object val = XCAR (objlist); | 2543 | Lisp_Object val = XCAR (objlist); |
| 2564 | struct font *font = XFONT_OBJECT (val); | 2544 | struct font *font = XFONT_OBJECT (val); |
| 2565 | 2545 | ||
| 2566 | font_assert (font && driver == font->driver); | 2546 | if (! NILP (AREF (val, FONT_TYPE_INDEX))) |
| 2567 | driver->close (f, font); | 2547 | { |
| 2568 | num_fonts--; | 2548 | font_assert (font && driver == font->driver); |
| 2549 | driver->close (f, font); | ||
| 2550 | num_fonts--; | ||
| 2551 | } | ||
| 2569 | } | 2552 | } |
| 2570 | if (driver->free_entity) | 2553 | if (driver->free_entity) |
| 2571 | driver->free_entity (entity); | 2554 | driver->free_entity (entity); |
| @@ -2754,7 +2737,8 @@ font_open_entity (f, entity, pixel_size) | |||
| 2754 | 2737 | ||
| 2755 | for (objlist = AREF (entity, FONT_OBJLIST_INDEX); CONSP (objlist); | 2738 | for (objlist = AREF (entity, FONT_OBJLIST_INDEX); CONSP (objlist); |
| 2756 | objlist = XCDR (objlist)) | 2739 | objlist = XCDR (objlist)) |
| 2757 | if (XFONT_OBJECT (XCAR (objlist))->pixel_size == pixel_size) | 2740 | if (! NILP (AREF (XCAR (objlist), FONT_TYPE_INDEX)) |
| 2741 | && XFONT_OBJECT (XCAR (objlist))->pixel_size == pixel_size) | ||
| 2758 | return XCAR (objlist); | 2742 | return XCAR (objlist); |
| 2759 | 2743 | ||
| 2760 | val = AREF (entity, FONT_TYPE_INDEX); | 2744 | val = AREF (entity, FONT_TYPE_INDEX); |
| @@ -2770,7 +2754,7 @@ font_open_entity (f, entity, pixel_size) | |||
| 2770 | return Qnil; | 2754 | return Qnil; |
| 2771 | ASET (entity, FONT_OBJLIST_INDEX, | 2755 | ASET (entity, FONT_OBJLIST_INDEX, |
| 2772 | Fcons (font_object, AREF (entity, FONT_OBJLIST_INDEX))); | 2756 | Fcons (font_object, AREF (entity, FONT_OBJLIST_INDEX))); |
| 2773 | ASET (font_object, FONT_OBJLIST_INDEX, AREF (entity, FONT_OBJLIST_INDEX)); | 2757 | ASET (font_object, FONT_OBJLIST_INDEX, Qnil); |
| 2774 | num_fonts++; | 2758 | num_fonts++; |
| 2775 | 2759 | ||
| 2776 | font = XFONT_OBJECT (font_object); | 2760 | font = XFONT_OBJECT (font_object); |
| @@ -2807,28 +2791,17 @@ font_close_object (f, font_object) | |||
| 2807 | Lisp_Object font_object; | 2791 | Lisp_Object font_object; |
| 2808 | { | 2792 | { |
| 2809 | struct font *font = XFONT_OBJECT (font_object); | 2793 | struct font *font = XFONT_OBJECT (font_object); |
| 2810 | Lisp_Object objlist; | ||
| 2811 | Lisp_Object tail, prev = Qnil; | ||
| 2812 | 2794 | ||
| 2813 | objlist = AREF (font_object, FONT_OBJLIST_INDEX); | 2795 | if (NILP (AREF (font_object, FONT_TYPE_INDEX))) |
| 2814 | for (prev = Qnil, tail = objlist; CONSP (tail); | 2796 | /* Already closed. */ |
| 2815 | prev = tail, tail = XCDR (tail)) | 2797 | return; |
| 2816 | if (EQ (font_object, XCAR (tail))) | 2798 | font_add_log ("close", font_object, Qnil); |
| 2817 | { | 2799 | font->driver->close (f, font); |
| 2818 | font_add_log ("close", font_object, Qnil); | ||
| 2819 | font->driver->close (f, font); | ||
| 2820 | #ifdef HAVE_WINDOW_SYSTEM | 2800 | #ifdef HAVE_WINDOW_SYSTEM |
| 2821 | font_assert (FRAME_X_DISPLAY_INFO (f)->n_fonts); | 2801 | font_assert (FRAME_X_DISPLAY_INFO (f)->n_fonts); |
| 2822 | FRAME_X_DISPLAY_INFO (f)->n_fonts--; | 2802 | FRAME_X_DISPLAY_INFO (f)->n_fonts--; |
| 2823 | #endif | 2803 | #endif |
| 2824 | if (NILP (prev)) | 2804 | num_fonts--; |
| 2825 | ASET (font_object, FONT_OBJLIST_INDEX, XCDR (objlist)); | ||
| 2826 | else | ||
| 2827 | XSETCDR (prev, XCDR (objlist)); | ||
| 2828 | num_fonts--; | ||
| 2829 | return; | ||
| 2830 | } | ||
| 2831 | abort (); | ||
| 2832 | } | 2805 | } |
| 2833 | 2806 | ||
| 2834 | 2807 | ||
| @@ -3544,7 +3517,6 @@ font_at (c, pos, face, w, string) | |||
| 3544 | if (! face->font) | 3517 | if (! face->font) |
| 3545 | return Qnil; | 3518 | return Qnil; |
| 3546 | 3519 | ||
| 3547 | font_assert (font_check_object ((struct font *) face->font)); | ||
| 3548 | XSETFONT (font_object, face->font); | 3520 | XSETFONT (font_object, face->font); |
| 3549 | return font_object; | 3521 | return font_object; |
| 3550 | } | 3522 | } |