paragraphSpacing applied to Unicode line separator

Originator:dan
Number:rdar://14872922 Date Originated:29-Aug-2013 03:51 PM
Status:Open Resolved:
Product:iOS SDK Product Version:iOS 7 DP6
Classification:other bug Reproducible:always
 
Summary:

In an attributed string, paragraphSpacing is incorrectly added after a Unicode line separator (\u2028).

Steps to Reproduce:

(1) Create a string containing a Unicode line separator (and, for comparison, a paragraph separator).
(2) Create attributes with line height multiple and paragraph spacing.
(3) Create attributed string with string and attributes.
(4) Assign attributed string to label text.

    static NSString *const kUnicodeLineSeparator = @"\u2028";
    static NSString *const kUnicodeParagraphSeparator = @"\u2029";
    NSString *string = [NSString stringWithFormat:@"line1%@line2%@paragraph2", kUnicodeLineSeparator, kUnicodeParagraphSeparator];
    NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init];
    style.lineHeightMultiple = 0.75;
    style.paragraphSpacing = 5;
    NSDictionary *attributes = @{
        NSParagraphStyleAttributeName: style
    };
    NSAttributedString *attributedString = [[NSAttributedString alloc] initWithString:string attributes:attributes];
    self.label.text = attributedString;

Expected Results:

Line 1 and line 2 are separated by 75% of the standard line spacing for the font.  Paragraph 2 is separated from line 2 by 5 additional points.

Actual Results:

Line 1 and line 2 are separated by 75% of the standard line spacing for the font plus 5 points.  Paragraph 2 is separated from line 2 by the same.

Regression:

Notes:

iOS 6 does this correctly.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!