summaryrefslogtreecommitdiff
path: root/src/font.c
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>2008-10-01 12:37:28 +0000
committerKenichi Handa <handa@m17n.org>2008-10-01 12:37:28 +0000
commit819ab95f726e46dfec4718de9185b288eb7fa8c6 (patch)
tree94b8d57ffc3fcd671ed7d004762d0f1a0bb753eb /src/font.c
parent183080b610ce4d3385d272aa26b61f3a54f7a9af (diff)
downloademacs-819ab95f726e46dfec4718de9185b288eb7fa8c6.tar.gz
(font_matching_entity): Reflect ATTRS in font selection.
(font_find_for_lface) [HAVE_NS]: Don't ignore case.
Diffstat (limited to 'src/font.c')
-rw-r--r--src/font.c24
1 files changed, 18 insertions, 6 deletions
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)
struct font_driver_list *driver_list = f->font_driver_list;
Lisp_Object ftype, size, entity;
Lisp_Object frame;
+ Lisp_Object work = Fcopy_font_spec (spec);
XSETFRAME (frame, f);
ftype = AREF (spec, FONT_TYPE_INDEX);
size = AREF (spec, FONT_SIZE_INDEX);
if (FLOATP (size))
ASET (spec, FONT_SIZE_INDEX, make_number (font_pixel_size (f, spec)));
+
+ FONT_SET_STYLE (work, FONT_WEIGHT_INDEX, attrs[LFACE_WEIGHT_INDEX]);
+ FONT_SET_STYLE (work, FONT_SLANT_INDEX, attrs[LFACE_SLANT_INDEX]);
+ FONT_SET_STYLE (work, FONT_WIDTH_INDEX, attrs[LFACE_SWIDTH_INDEX]);
+
entity = Qnil;
for (; driver_list; driver_list = driver_list->next)
if (driver_list->on
@@ -2779,14 +2785,14 @@ font_matching_entity (f, attrs, spec)
Lisp_Object cache = font_get_cache (f, driver_list->driver);
Lisp_Object copy;
- ASET (spec, FONT_TYPE_INDEX, driver_list->driver->type);
- entity = assoc_no_quit (spec, XCDR (cache));
+ ASET (work, FONT_TYPE_INDEX, driver_list->driver->type);
+ entity = assoc_no_quit (work, XCDR (cache));
if (CONSP (entity))
entity = XCDR (entity);
else
{
- entity = driver_list->driver->match (frame, spec);
- copy = Fcopy_font_spec (spec);
+ entity = driver_list->driver->match (frame, work);
+ copy = Fcopy_font_spec (work);
ASET (copy, FONT_TYPE_INDEX, driver_list->driver->type);
XSETCDR (cache, Fcons (Fcons (copy, entity), XCDR (cache)));
}
@@ -2795,7 +2801,7 @@ font_matching_entity (f, attrs, spec)
}
ASET (spec, FONT_TYPE_INDEX, ftype);
ASET (spec, FONT_SIZE_INDEX, size);
- font_add_log ("match", spec, entity);
+ font_add_log ("match", work, entity);
return entity;
}
@@ -3166,7 +3172,13 @@ font_find_for_lface (f, attrs, spec, c)
else
{
Lisp_Object alters
- = Fassoc_string (val, Vface_alternative_font_family_alist, Qt);
+ = Fassoc_string (val, Vface_alternative_font_family_alist,
+#ifndef HAVE_NS
+ Qt
+#else
+ Qnil
+#endif
+ );
if (! NILP (alters))
{