aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2008-10-01 12:37:28 +0000
committerKenichi Handa2008-10-01 12:37:28 +0000
commit819ab95f726e46dfec4718de9185b288eb7fa8c6 (patch)
tree94b8d57ffc3fcd671ed7d004762d0f1a0bb753eb /src
parent183080b610ce4d3385d272aa26b61f3a54f7a9af (diff)
downloademacs-819ab95f726e46dfec4718de9185b288eb7fa8c6.tar.gz
emacs-819ab95f726e46dfec4718de9185b288eb7fa8c6.zip
(font_matching_entity): Reflect ATTRS in font selection.
(font_find_for_lface) [HAVE_NS]: Don't ignore case.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/font.c24
2 files changed, 23 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 6cf8ee7fce3..8603222ea32 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12008-10-01 Adrian Robert <Adrian.B.Robert@gmail.com>
2
3 * font.c (font_matching_entity): Reflect ATTRS in font selection.
4 (font_find_for_lface) [HAVE_NS]: Don't ignore case.
5
12008-09-30 Stefan Monnier <monnier@iro.umontreal.ca> 62008-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
2 7
3 * dispnew.c (Fsend_string_to_terminal): Don't try to send a string to 8 * dispnew.c (Fsend_string_to_terminal): Don't try to send a string to
diff --git a/src/font.c b/src/font.c
index ba05b57a001..816ce9a674f 100644
--- a/src/font.c
+++ b/src/font.c
@@ -2765,12 +2765,18 @@ font_matching_entity (f, attrs, spec)
2765 struct font_driver_list *driver_list = f->font_driver_list; 2765 struct font_driver_list *driver_list = f->font_driver_list;
2766 Lisp_Object ftype, size, entity; 2766 Lisp_Object ftype, size, entity;
2767 Lisp_Object frame; 2767 Lisp_Object frame;
2768 Lisp_Object work = Fcopy_font_spec (spec);
2768 2769
2769 XSETFRAME (frame, f); 2770 XSETFRAME (frame, f);
2770 ftype = AREF (spec, FONT_TYPE_INDEX); 2771 ftype = AREF (spec, FONT_TYPE_INDEX);
2771 size = AREF (spec, FONT_SIZE_INDEX); 2772 size = AREF (spec, FONT_SIZE_INDEX);
2772 if (FLOATP (size)) 2773 if (FLOATP (size))
2773 ASET (spec, FONT_SIZE_INDEX, make_number (font_pixel_size (f, spec))); 2774 ASET (spec, FONT_SIZE_INDEX, make_number (font_pixel_size (f, spec)));
2775
2776 FONT_SET_STYLE (work, FONT_WEIGHT_INDEX, attrs[LFACE_WEIGHT_INDEX]);
2777 FONT_SET_STYLE (work, FONT_SLANT_INDEX, attrs[LFACE_SLANT_INDEX]);
2778 FONT_SET_STYLE (work, FONT_WIDTH_INDEX, attrs[LFACE_SWIDTH_INDEX]);
2779
2774 entity = Qnil; 2780 entity = Qnil;
2775 for (; driver_list; driver_list = driver_list->next) 2781 for (; driver_list; driver_list = driver_list->next)
2776 if (driver_list->on 2782 if (driver_list->on
@@ -2779,14 +2785,14 @@ font_matching_entity (f, attrs, spec)
2779 Lisp_Object cache = font_get_cache (f, driver_list->driver); 2785 Lisp_Object cache = font_get_cache (f, driver_list->driver);
2780 Lisp_Object copy; 2786 Lisp_Object copy;
2781 2787
2782 ASET (spec, FONT_TYPE_INDEX, driver_list->driver->type); 2788 ASET (work, FONT_TYPE_INDEX, driver_list->driver->type);
2783 entity = assoc_no_quit (spec, XCDR (cache)); 2789 entity = assoc_no_quit (work, XCDR (cache));
2784 if (CONSP (entity)) 2790 if (CONSP (entity))
2785 entity = XCDR (entity); 2791 entity = XCDR (entity);
2786 else 2792 else
2787 { 2793 {
2788 entity = driver_list->driver->match (frame, spec); 2794 entity = driver_list->driver->match (frame, work);
2789 copy = Fcopy_font_spec (spec); 2795 copy = Fcopy_font_spec (work);
2790 ASET (copy, FONT_TYPE_INDEX, driver_list->driver->type); 2796 ASET (copy, FONT_TYPE_INDEX, driver_list->driver->type);
2791 XSETCDR (cache, Fcons (Fcons (copy, entity), XCDR (cache))); 2797 XSETCDR (cache, Fcons (Fcons (copy, entity), XCDR (cache)));
2792 } 2798 }
@@ -2795,7 +2801,7 @@ font_matching_entity (f, attrs, spec)
2795 } 2801 }
2796 ASET (spec, FONT_TYPE_INDEX, ftype); 2802 ASET (spec, FONT_TYPE_INDEX, ftype);
2797 ASET (spec, FONT_SIZE_INDEX, size); 2803 ASET (spec, FONT_SIZE_INDEX, size);
2798 font_add_log ("match", spec, entity); 2804 font_add_log ("match", work, entity);
2799 return entity; 2805 return entity;
2800} 2806}
2801 2807
@@ -3166,7 +3172,13 @@ font_find_for_lface (f, attrs, spec, c)
3166 else 3172 else
3167 { 3173 {
3168 Lisp_Object alters 3174 Lisp_Object alters
3169 = Fassoc_string (val, Vface_alternative_font_family_alist, Qt); 3175 = Fassoc_string (val, Vface_alternative_font_family_alist,
3176#ifndef HAVE_NS
3177 Qt
3178#else
3179 Qnil
3180#endif
3181 );
3170 3182
3171 if (! NILP (alters)) 3183 if (! NILP (alters))
3172 { 3184 {