From 2767d3548ea4e221576b919869c58fbb49b34143 Mon Sep 17 00:00:00 2001 From: fredkiefer Date: Fri, 30 Aug 2013 15:30:22 +0000 Subject: [PATCH] * Source\NSAttributedString.m (-fixFontAttributeInRange:): In * the absence of a NSFontAttributeName attribute, use a default font to prevent the substitution from stopping. This fixes a bug where unicode characters would not get the proper font substitution. Patch by: Frank Le Grand git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@37027 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 8 ++++++++ Source/NSAttributedString.m | 10 ++++++++++ 2 files changed, 18 insertions(+) diff --git a/ChangeLog b/ChangeLog index e6f3ec881..53f8bc656 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2013-08-30 Fred Kiefer + + * Source\NSAttributedString.m (-fixFontAttributeInRange:): In the + absence of a NSFontAttributeName attribute, use a default font to + prevent the substitution from stopping. This fixes a bug where + unicode characters would not get the proper font substitution. + Patch by: Frank Le Grand + 2013-08-30 Fred Kiefer * Headers/Additions/GNUstepGUI/GSDisplayServer.h diff --git a/Source/NSAttributedString.m b/Source/NSAttributedString.m index d3e419457..9a62974a1 100644 --- a/Source/NSAttributedString.m +++ b/Source/NSAttributedString.m @@ -1596,6 +1596,16 @@ static NSMutableDictionary *cachedCSets = nil; font = [self attribute: NSFontAttributeName atIndex: i effectiveRange: &fontRange]; + + /* If we don't have an attribute for NSFontAttributeName, + ** we take a default font so we can carry on with the + ** substitution. + */ + if (nil == font) + { + font = [NSFont userFontOfSize:0.0]; + } + charset = [font coveredCharacterSet]; }