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]; }