From e1a5ba7399e0da833d660cb7aea7aac6850b9a1c Mon Sep 17 00:00:00 2001 From: Adrian Robert Date: Fri, 24 Jul 2009 15:46:56 +0000 Subject: [PATCH] * nsfont.m (ns_findfonts): Correctly return fallback in match case. --- src/ChangeLog | 4 ++++ src/nsfont.m | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 3295afcfad1..0d13f9ad973 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 032ea39aef4..8f90e7a3eba 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))); -- 2.39.2