summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Robert <Adrian.B.Robert@gmail.com>2009-07-29 16:04:30 +0000
committerAdrian Robert <Adrian.B.Robert@gmail.com>2009-07-29 16:04:30 +0000
commit3a23f35634531aaa58cd14c107894b5ecd3b57f1 (patch)
treec9cff5ebde84d057396e4935b308e3ca0a47a318
parentf559090b056740f14abb1290ceff3c9626fe869a (diff)
downloademacs-3a23f35634531aaa58cd14c107894b5ecd3b57f1.tar.gz
* nsfont.m (ns_findfonts): Fix 2009-07-24 change to return only one element, not a list, for match case.
-rw-r--r--src/ChangeLog5
-rw-r--r--src/nsfont.m15
2 files changed, 14 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index b6ce0fad6f2..e13d7bef7aa 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2009-07-29 Adrian Robert <Adrian.B.Robert@gmail.com>
+
+ * nsfont.m (ns_findfonts): Fix 2009-07-24 change to return only one
+ element, not a list, for match case.
+
2009-07-28 Kenichi Handa <handa@m17n.org>
* xfaces.c (face_with_height): Call font_clear_prop.
diff --git a/src/nsfont.m b/src/nsfont.m
index 78f4f1a6a6c..b3abf1aeeb6 100644
--- a/src/nsfont.m
+++ b/src/nsfont.m
@@ -464,7 +464,7 @@ ns_findfonts (Lisp_Object font_spec, BOOL isMatch)
/* If has non-unicode registry, give up. */
tem = AREF (font_spec, FONT_REGISTRY_INDEX);
if (! NILP (tem) && !EQ (tem, Qiso10646_1) && !EQ (tem, Qunicode_bmp))
- return isMatch ? Fcons (ns_fallback_entity (), list) : Qnil;
+ return isMatch ? ns_fallback_entity () : Qnil;
cFamilies = ns_get_covering_families (ns_get_req_script (font_spec), 0.90);
@@ -483,9 +483,12 @@ ns_findfonts (Lisp_Object font_spec, BOOL isMatch)
if (![cFamilies containsObject:
[desc objectForKey: NSFontFamilyAttribute]])
continue;
- list = Fcons (ns_descriptor_to_entity (desc,
- AREF (font_spec, FONT_EXTRA_INDEX),
- NULL), list);
+ tem = ns_descriptor_to_entity (desc,
+ AREF (font_spec, FONT_EXTRA_INDEX),
+ NULL);
+ if (isMatch)
+ return tem;
+ list = Fcons (tem, list);
if (fabs (ns_attribute_fvalue (desc, NSFontSlantTrait)) > 0.05)
foundItal = YES;
}
@@ -503,8 +506,8 @@ ns_findfonts (Lisp_Object font_spec, BOOL isMatch)
}
/* Return something if was a match and nothing found. */
- if (isMatch && XINT (Flength (list)) == 0)
- list = Fcons (ns_fallback_entity (), Qnil);
+ if (isMatch)
+ return ns_fallback_entity ();
if (NSFONT_TRACE)
fprintf (stderr, " Returning %d entities.\n", XINT (Flength (list)));