diff options
| author | Kenichi Handa | 2010-11-04 15:46:30 -0400 |
|---|---|---|
| committer | Chong Yidong | 2010-11-04 15:46:30 -0400 |
| commit | 68ae6cda9e2a55c23d9680953bf9a402616e6901 (patch) | |
| tree | d02b46763d64847f6161bd570ec0f21159e0561f /src | |
| parent | db5cada28d2c7cc54afdeaead30d639ebba507fc (diff) | |
| download | emacs-68ae6cda9e2a55c23d9680953bf9a402616e6901.tar.gz emacs-68ae6cda9e2a55c23d9680953bf9a402616e6901.zip | |
Backport 2010-05-27T04:24:30Z!handa@etlken from trunk
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/font.c | 37 |
2 files changed, 42 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 1e084a4bc3a..077385d6f6c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2010-11-04 Kenichi Handa <handa@m17n.org> | ||
| 2 | |||
| 3 | * font.c (font_delete_unmatched): Check Vface_ignored_fonts. | ||
| 4 | Don't sheck SPEC if it is nil. | ||
| 5 | (font_list_entities): Call font_delete_unmatched if | ||
| 6 | Vface_ignored_fonts is non-nil. | ||
| 7 | |||
| 1 | 2010-11-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | 8 | 2010-11-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> |
| 2 | 9 | ||
| 3 | * dispextern.h (TRY_WINDOW_CHECK_MARGINS) | 10 | * dispextern.h (TRY_WINDOW_CHECK_MARGINS) |
diff --git a/src/font.c b/src/font.c index 77f43c81d71..f65b04255e2 100644 --- a/src/font.c +++ b/src/font.c | |||
| @@ -2821,6 +2821,14 @@ font_clear_cache (f, cache, driver) | |||
| 2821 | 2821 | ||
| 2822 | static Lisp_Object scratch_font_spec, scratch_font_prefer; | 2822 | static Lisp_Object scratch_font_spec, scratch_font_prefer; |
| 2823 | 2823 | ||
| 2824 | /* Check each font-entity in VEC, and return a list of font-entities | ||
| 2825 | that satisfy this condition: | ||
| 2826 | (1) matches with SPEC and SIZE if SPEC is not nil, and | ||
| 2827 | (2) doesn't match with any regexps in Vface_ignored_fonts (if non-nil). | ||
| 2828 | */ | ||
| 2829 | |||
| 2830 | extern Lisp_Object Vface_ignored_fonts; | ||
| 2831 | |||
| 2824 | Lisp_Object | 2832 | Lisp_Object |
| 2825 | font_delete_unmatched (vec, spec, size) | 2833 | font_delete_unmatched (vec, spec, size) |
| 2826 | Lisp_Object vec, spec; | 2834 | Lisp_Object vec, spec; |
| @@ -2833,6 +2841,29 @@ font_delete_unmatched (vec, spec, size) | |||
| 2833 | for (val = Qnil, i = ASIZE (vec) - 1; i >= 0; i--) | 2841 | for (val = Qnil, i = ASIZE (vec) - 1; i >= 0; i--) |
| 2834 | { | 2842 | { |
| 2835 | entity = AREF (vec, i); | 2843 | entity = AREF (vec, i); |
| 2844 | if (! NILP (Vface_ignored_fonts)) | ||
| 2845 | { | ||
| 2846 | char name[256]; | ||
| 2847 | Lisp_Object tail, regexp; | ||
| 2848 | |||
| 2849 | if (font_unparse_xlfd (entity, 0, name, 256) >= 0) | ||
| 2850 | { | ||
| 2851 | for (tail = Vface_ignored_fonts; CONSP (tail); tail = XCDR (tail)) | ||
| 2852 | { | ||
| 2853 | regexp = XCAR (tail); | ||
| 2854 | if (STRINGP (regexp) | ||
| 2855 | && fast_c_string_match_ignore_case (regexp, name) >= 0) | ||
| 2856 | break; | ||
| 2857 | } | ||
| 2858 | if (CONSP (tail)) | ||
| 2859 | continue; | ||
| 2860 | } | ||
| 2861 | } | ||
| 2862 | if (NILP (spec)) | ||
| 2863 | { | ||
| 2864 | val = Fcons (entity, val); | ||
| 2865 | continue; | ||
| 2866 | } | ||
| 2836 | for (prop = FONT_WEIGHT_INDEX; prop < FONT_SIZE_INDEX; prop++) | 2867 | for (prop = FONT_WEIGHT_INDEX; prop < FONT_SIZE_INDEX; prop++) |
| 2837 | if (INTEGERP (AREF (spec, prop)) | 2868 | if (INTEGERP (AREF (spec, prop)) |
| 2838 | && ((XINT (AREF (spec, prop)) >> 8) | 2869 | && ((XINT (AREF (spec, prop)) >> 8) |
| @@ -2932,8 +2963,10 @@ font_list_entities (frame, spec) | |||
| 2932 | ASET (copy, FONT_TYPE_INDEX, driver_list->driver->type); | 2963 | ASET (copy, FONT_TYPE_INDEX, driver_list->driver->type); |
| 2933 | XSETCDR (cache, Fcons (Fcons (copy, val), XCDR (cache))); | 2964 | XSETCDR (cache, Fcons (Fcons (copy, val), XCDR (cache))); |
| 2934 | } | 2965 | } |
| 2935 | if (ASIZE (val) > 0 && need_filtering) | 2966 | if (ASIZE (val) > 0 |
| 2936 | val = font_delete_unmatched (val, spec, size); | 2967 | && (need_filtering |
| 2968 | || ! NILP (Vface_ignored_fonts))) | ||
| 2969 | val = font_delete_unmatched (val, need_filtering ? spec : Qnil, size); | ||
| 2937 | if (ASIZE (val) > 0) | 2970 | if (ASIZE (val) > 0) |
| 2938 | list = Fcons (val, list); | 2971 | list = Fcons (val, list); |
| 2939 | } | 2972 | } |