# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1617962482 0 # Node ID ba24ddb19a435209fafae0d1edfd771a037c88f2 # Parent 42ba334cb8f7782e967d4b83a4e79b07ee9c0cc2 iOS: Fix font and colors on MLE imported text. diff -r 42ba334cb8f7 -r ba24ddb19a43 ios/dw.m --- a/ios/dw.m Fri Apr 09 09:48:13 2021 +0000 +++ b/ios/dw.m Fri Apr 09 10:01:22 2021 +0000 @@ -4836,7 +4836,13 @@ unsigned int retval; NSTextStorage *ts = [mle textStorage]; NSString *nstr = [NSString stringWithUTF8String:buffer]; - NSAttributedString *nastr = [[NSAttributedString alloc] initWithString:nstr]; + UIColor *fgcolor = [mle textColor]; + UIFont *font = [mle font]; + NSMutableDictionary *attributes = [[NSMutableDictionary alloc] init]; + [attributes setObject:(fgcolor ? fgcolor : [UIColor labelColor]) forKey:NSForegroundColorAttributeName]; + if(font) + [attributes setObject:font forKey:NSFontAttributeName]; + NSAttributedString *nastr = [[NSAttributedString alloc] initWithString:nstr attributes:attributes]; NSUInteger length = [ts length]; if(startpoint < 0) startpoint = 0;