# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1611658963 0 # Node ID 7cd64f66f1ccac961759f4e24fb433541276bf8c # Parent 9772a2306b43096c3b29921b69b70749d3cecd8b Mac: Need to use the font and color set on the NSTextStorage when creating the attributes for adding text in dw_mle_import(). diff -r 9772a2306b43 -r 7cd64f66f1cc mac/dw.m --- a/mac/dw.m Mon Jan 25 22:09:49 2021 +0000 +++ b/mac/dw.m Tue Jan 26 11:02:43 2021 +0000 @@ -6345,7 +6345,12 @@ unsigned int retval; NSTextStorage *ts = [mle textStorage]; NSString *nstr = [NSString stringWithUTF8String:buffer]; - NSDictionary *attributes = [NSDictionary dictionaryWithObject:NSColor.textColor forKey:NSForegroundColorAttributeName]; + NSColor *fgcolor = [ts foregroundColor]; + NSFont *font = [ts font]; + NSMutableDictionary *attributes = [[NSMutableDictionary alloc] init]; + [attributes setObject:(fgcolor ? fgcolor : NSColor.textColor) forKey:NSForegroundColorAttributeName]; + if(font) + [attributes setObject:font forKey:NSFontAttributeName]; NSAttributedString *nastr = [[NSAttributedString alloc] initWithString:nstr attributes:attributes]; NSUInteger length = [ts length]; if(startpoint < 0)