diff options
-rw-r--r-- | src/ChangeLog | 4 | ||||
-rw-r--r-- | src/nsfont.m | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 24f3305b870..a2f39db5a88 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change) + + * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541). + 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca> Use ad-hoc comparison function for the profiler's hash-tables. diff --git a/src/nsfont.m b/src/nsfont.m index 4f29d1d54a9..d2e5108bb7f 100644 --- a/src/nsfont.m +++ b/src/nsfont.m @@ -559,7 +559,11 @@ ns_findfonts (Lisp_Object font_spec, BOOL isMatch) if (isMatch) [fkeys removeObject: NSFontFamilyAttribute]; - matchingDescs = [fdesc matchingFontDescriptorsWithMandatoryKeys: fkeys]; + if ([fkeys count] > 0) + matchingDescs = [fdesc matchingFontDescriptorsWithMandatoryKeys: fkeys]; + else + matchingDescs = [NSMutableArray array]; + if (NSFONT_TRACE) NSLog(@"Got desc %@ and found %d matching fonts from it: ", fdesc, [matchingDescs count]); |