From: Adrian Robert Date: Fri, 24 Jul 2009 15:43:22 +0000 (+0000) Subject: * nsfont.m (ns_findfonts): Correctly return fallback in match case. X-Git-Tag: emacs-pretest-23.1.90~2033 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1395c6f54c37e5ee4e870d39180b07dba2060b73;p=emacs.git * nsfont.m (ns_findfonts): Correctly return fallback in match case. --- diff --git a/src/ChangeLog b/src/ChangeLog index 5ec38e71b7c..7814f8a637e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2009-07-24 Adrian Robert + + * nsfont.m (ns_findfonts): Correctly return fallback in match case. + 2009-07-23 Yavor Doganov * nsfont.m (NSFontDescriptor.h): Explicitly include under GNUstep. diff --git a/src/nsfont.m b/src/nsfont.m index 33bbe37ab65..100676762a8 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 ? ns_fallback_entity () : Qnil; + return isMatch ? Fcons (ns_fallback_entity (), list) : Qnil; cFamilies = ns_get_covering_families (ns_get_req_script (font_spec), 0.90); @@ -502,6 +502,10 @@ ns_findfonts (Lisp_Object font_spec, BOOL isMatch) "synthItal"), list); } + /* Return something if was a match and nothing found. */ + if (isMatch && XINT (Flength (list)) == 0) + list = Fcons (ns_fallback_entity (), Qnil); + if (NSFONT_TRACE) fprintf (stderr, " Returning %d entities.\n", XINT (Flength (list)));