diff --git a/Podfile.lock b/Podfile.lock index b281b28df..3d5c53f45 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -17,4 +17,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 1b4ea0e8ab7d94a46b1964a2354686c2e599c8c2 -COCOAPODS: 1.10.0 +COCOAPODS: 1.10.1 diff --git a/Source/TextExperiment/Component/ASTextLayout.mm b/Source/TextExperiment/Component/ASTextLayout.mm index f01c25908..4c856c870 100644 --- a/Source/TextExperiment/Component/ASTextLayout.mm +++ b/Source/TextExperiment/Component/ASTextLayout.mm @@ -395,6 +395,53 @@ + (ASTextLayout *)layoutWithContainer:(ASTextContainer *)container text:(NSAttri return [self layoutWithContainer:container text:text range:NSMakeRange(0, text.length)]; } ++ (BOOL)_isBeginningLineIndexOfParagraph:(NSAttributedString *)text index:(NSUInteger)index +{ + NSString *string = [text string]; + NSUInteger length = [string length]; + + NSRange paragraphRange = [self _rangeOfParagraphsContainingRange:string range:NSMakeRange(0, 0) parBegIndex:NULL parEndIndex:NULL]; + + while (paragraphRange.length) + { + if (index == paragraphRange.location) { + return true; + } + if (index < paragraphRange.location) { + return false; + } + NSUInteger nextParagraphBegin = NSMaxRange(paragraphRange); + if (nextParagraphBegin>=length) + { + break; + } + // next paragraph + paragraphRange = [self _rangeOfParagraphsContainingRange:string range:NSMakeRange(nextParagraphBegin, 0) parBegIndex:NULL parEndIndex:NULL]; + } + return false; +} + ++ (NSRange)_rangeOfParagraphsContainingRange:(NSString *)text range:(NSRange)range parBegIndex:(NSUInteger *)parBegIndex parEndIndex:(NSUInteger *)parEndIndex +{ + // get beginning and end of paragraph containing the replaced range + CFIndex beginIndex; + CFIndex endIndex; + + CFStringGetParagraphBounds((__bridge CFStringRef)text, CFRangeMake(range.location, range.length), &beginIndex, &endIndex, NULL); + + if (parBegIndex) + { + *parBegIndex = beginIndex; + } + + if (parEndIndex) + { + *parEndIndex = endIndex; + } + // endIndex is the first character of the following paragraph, so we don't need to add 1 + return NSMakeRange(beginIndex, endIndex - beginIndex); +} + + (ASTextLayout *)layoutWithContainer:(ASTextContainer *)container text:(NSAttributedString *)text range:(NSRange)range { ASTextLayout *layout = NULL; CGPathRef cgPath = nil; @@ -864,10 +911,25 @@ + (ASTextLayout *)layoutWithContainer:(ASTextContainer *)container text:(NSAttri [lastLineText insertAttributedString:truncationToken atIndex:0]; } } + + CGFloat headIndent = 0; + + BOOL isAtBeginOfParagraph = [self _isBeginningLineIndexOfParagraph:text index:lastLine.range.location]; + // get the paragraph style at this index + CTParagraphStyleRef paragraphStyle = (__bridge CTParagraphStyleRef)[text attribute:(id)kCTParagraphStyleAttributeName atIndex:lastRange.location effectiveRange:NULL]; + + if (isAtBeginOfParagraph) + { + CTParagraphStyleGetValueForSpecifier(paragraphStyle, kCTParagraphStyleSpecifierFirstLineHeadIndent, sizeof(headIndent), &headIndent); + } + else + { + CTParagraphStyleGetValueForSpecifier(paragraphStyle, kCTParagraphStyleSpecifierHeadIndent, sizeof(headIndent), &headIndent); + } CTLineRef ctLastLineExtend = CTLineCreateWithAttributedString((CFAttributedStringRef) lastLineText); if (ctLastLineExtend) { - CTLineRef ctTruncatedLine = CTLineCreateTruncatedLine(ctLastLineExtend, truncatedWidth, type, truncationTokenLine); + CTLineRef ctTruncatedLine = CTLineCreateTruncatedLine(ctLastLineExtend, truncatedWidth - headIndent, type, truncationTokenLine); CFRelease(ctLastLineExtend); if (ctTruncatedLine) { truncatedLine = [ASTextLine lineWithCTLine:ctTruncatedLine position:lastLine.position vertical:isVerticalForm]; diff --git a/Tests/ASTextNode2SnapshotTests.mm b/Tests/ASTextNode2SnapshotTests.mm index 0cda2ce45..caca3700c 100644 --- a/Tests/ASTextNode2SnapshotTests.mm +++ b/Tests/ASTextNode2SnapshotTests.mm @@ -205,6 +205,167 @@ - (void)testTextTruncationModes_ASTextNode2 } } +- (void)testTextTruncationModes_with_headIndentAttribute_ASTextNode2 +{ + UIView *container = [[UIView alloc] initWithFrame:(CGRect) {CGPointZero, (CGSize) {375.0f, 667.0f}}]; + + UILabel *textNodeLabel = [[UILabel alloc] init]; + UILabel *uiLabelLabel = [[UILabel alloc] init]; + UILabel *description = [[UILabel alloc] init]; + textNodeLabel.text = @"ASTextNode2:"; + textNodeLabel.font = [UIFont boldSystemFontOfSize:16.0]; + textNodeLabel.textColor = [UIColor colorWithRed:0.0 green:0.7 blue:0.0 alpha:1.0]; + uiLabelLabel.text = @"UILabel:"; + uiLabelLabel.font = [UIFont boldSystemFontOfSize:16.0]; + uiLabelLabel.textColor = [UIColor colorWithRed:0.0 green:0.7 blue:0.0 alpha:1.0]; + + description.text = @""; + description.font = [UIFont italicSystemFontOfSize:16.0]; + description.numberOfLines = 0; + + uiLabelLabel.textColor = [UIColor colorWithRed:0.0 green:0.7 blue:0.0 alpha:1.0]; + + UILabel *reference = [[UILabel alloc] init]; + ASTextNode *textNode = [[ASTextNode alloc] init]; // ASTextNode2 + + NSMutableAttributedString *refString = [[NSMutableAttributedString alloc] initWithString:@"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." + attributes:@{ NSFontAttributeName : [UIFont systemFontOfSize:18.0f] }]; + + NSMutableAttributedString *asString = [refString mutableCopy]; + + NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init]; + paragraphStyle.headIndent = 20; // Head Indent for Testing + + [refString addAttributes:@{ NSParagraphStyleAttributeName : paragraphStyle} range:NSMakeRange(0, [refString length])]; + [asString addAttributes:@{ NSParagraphStyleAttributeName : paragraphStyle} range:NSMakeRange(0, [asString length])]; + + reference.attributedText = refString; + textNode.attributedText = asString; + + CGSize size = (CGSize) {container.bounds.size.width, 120.0}; + CGPoint origin = (CGPoint) {CGRectGetWidth(container.bounds) / 2 - size.width / 2, CGRectGetHeight(container.bounds) / 2 - size.height / 2}; // center + + textNode.frame = (CGRect) {origin, size}; + reference.frame = CGRectOffset(textNode.frame, 0, -160.0f); + + textNodeLabel.bounds = (CGRect) {CGPointZero, (CGSize) {container.bounds.size.width, textNodeLabel.font.lineHeight}}; + origin = (CGPoint) {textNode.frame.origin.x, textNode.frame.origin.y - textNodeLabel.bounds.size.height}; + textNodeLabel.frame = (CGRect) {origin, textNodeLabel.bounds.size}; + + uiLabelLabel.bounds = (CGRect) {CGPointZero, (CGSize) {container.bounds.size.width, uiLabelLabel.font.lineHeight}}; + origin = (CGPoint) {reference.frame.origin.x, reference.frame.origin.y - uiLabelLabel.bounds.size.height}; + uiLabelLabel.frame = (CGRect) {origin, uiLabelLabel.bounds.size}; + + uiLabelLabel.bounds = (CGRect) {CGPointZero, (CGSize) {container.bounds.size.width, uiLabelLabel.font.lineHeight}}; + origin = (CGPoint) {textNode.frame.origin.x, textNode.frame.origin.y - uiLabelLabel.bounds.size.height}; + uiLabelLabel.frame = (CGRect) {origin, uiLabelLabel.bounds.size}; + + uiLabelLabel.bounds = (CGRect) {CGPointZero, (CGSize) {container.bounds.size.width, uiLabelLabel.font.lineHeight}}; + origin = (CGPoint) {reference.frame.origin.x, reference.frame.origin.y - uiLabelLabel.bounds.size.height}; + uiLabelLabel.frame = (CGRect) {origin, uiLabelLabel.bounds.size}; + + description.bounds = textNode.bounds; + description.frame = (CGRect) {(CGPoint) {0, container.bounds.size.height * 0.8}, description.bounds.size}; + + [container addSubview:reference]; + [container addSubview:textNode.view]; + [container addSubview:textNodeLabel]; + [container addSubview:uiLabelLabel]; + [container addSubview:description]; + + NSArray *c = [LineBreakConfig configs]; + for (LineBreakConfig *config in c) { + reference.lineBreakMode = textNode.truncationMode = config.lineBreakMode; + reference.numberOfLines = textNode.maximumNumberOfLines = config.numberOfLines; + description.text = config.description; + [container setNeedsLayout]; + NSString *identifier = [NSString stringWithFormat:@"%@_%luLines", [config breakModeDescription], (unsigned long)config.numberOfLines]; + [ASSnapshotTestCase hackilySynchronouslyRecursivelyRenderNode:textNode]; + ASSnapshotVerifyViewWithTolerance(container, identifier, 0.01); + } +} + +- (void)testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2 +{ + UIView *container = [[UIView alloc] initWithFrame:(CGRect) {CGPointZero, (CGSize) {375.0f, 667.0f}}]; + + UILabel *textNodeLabel = [[UILabel alloc] init]; + UILabel *uiLabelLabel = [[UILabel alloc] init]; + UILabel *description = [[UILabel alloc] init]; + textNodeLabel.text = @"ASTextNode2:"; + textNodeLabel.font = [UIFont boldSystemFontOfSize:16.0]; + textNodeLabel.textColor = [UIColor colorWithRed:0.0 green:0.7 blue:0.0 alpha:1.0]; + uiLabelLabel.text = @"UILabel:"; + uiLabelLabel.font = [UIFont boldSystemFontOfSize:16.0]; + uiLabelLabel.textColor = [UIColor colorWithRed:0.0 green:0.7 blue:0.0 alpha:1.0]; + + description.text = @""; + description.font = [UIFont italicSystemFontOfSize:16.0]; + description.numberOfLines = 0; + + uiLabelLabel.textColor = [UIColor colorWithRed:0.0 green:0.7 blue:0.0 alpha:1.0]; + + UILabel *reference = [[UILabel alloc] init]; + ASTextNode *textNode = [[ASTextNode alloc] init]; // ASTextNode2 + + NSMutableAttributedString *refString = [[NSMutableAttributedString alloc] initWithString:@"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." + attributes:@{ NSFontAttributeName : [UIFont systemFontOfSize:18.0f] }]; + + NSMutableAttributedString *asString = [refString mutableCopy]; + + NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init]; + paragraphStyle.firstLineHeadIndent = 20; // Head Indent for Testing + + [refString addAttributes:@{ NSParagraphStyleAttributeName : paragraphStyle} range:NSMakeRange(0, [refString length])]; + [asString addAttributes:@{ NSParagraphStyleAttributeName : paragraphStyle} range:NSMakeRange(0, [asString length])]; + + reference.attributedText = refString; + textNode.attributedText = asString; + + CGSize size = (CGSize) {container.bounds.size.width, 120.0}; + CGPoint origin = (CGPoint) {CGRectGetWidth(container.bounds) / 2 - size.width / 2, CGRectGetHeight(container.bounds) / 2 - size.height / 2}; // center + + textNode.frame = (CGRect) {origin, size}; + reference.frame = CGRectOffset(textNode.frame, 0, -160.0f); + + textNodeLabel.bounds = (CGRect) {CGPointZero, (CGSize) {container.bounds.size.width, textNodeLabel.font.lineHeight}}; + origin = (CGPoint) {textNode.frame.origin.x, textNode.frame.origin.y - textNodeLabel.bounds.size.height}; + textNodeLabel.frame = (CGRect) {origin, textNodeLabel.bounds.size}; + + uiLabelLabel.bounds = (CGRect) {CGPointZero, (CGSize) {container.bounds.size.width, uiLabelLabel.font.lineHeight}}; + origin = (CGPoint) {reference.frame.origin.x, reference.frame.origin.y - uiLabelLabel.bounds.size.height}; + uiLabelLabel.frame = (CGRect) {origin, uiLabelLabel.bounds.size}; + + uiLabelLabel.bounds = (CGRect) {CGPointZero, (CGSize) {container.bounds.size.width, uiLabelLabel.font.lineHeight}}; + origin = (CGPoint) {textNode.frame.origin.x, textNode.frame.origin.y - uiLabelLabel.bounds.size.height}; + uiLabelLabel.frame = (CGRect) {origin, uiLabelLabel.bounds.size}; + + uiLabelLabel.bounds = (CGRect) {CGPointZero, (CGSize) {container.bounds.size.width, uiLabelLabel.font.lineHeight}}; + origin = (CGPoint) {reference.frame.origin.x, reference.frame.origin.y - uiLabelLabel.bounds.size.height}; + uiLabelLabel.frame = (CGRect) {origin, uiLabelLabel.bounds.size}; + + description.bounds = textNode.bounds; + description.frame = (CGRect) {(CGPoint) {0, container.bounds.size.height * 0.8}, description.bounds.size}; + + [container addSubview:reference]; + [container addSubview:textNode.view]; + [container addSubview:textNodeLabel]; + [container addSubview:uiLabelLabel]; + [container addSubview:description]; + + NSArray *c = [LineBreakConfig configs]; + for (LineBreakConfig *config in c) { + reference.lineBreakMode = textNode.truncationMode = config.lineBreakMode; + reference.numberOfLines = textNode.maximumNumberOfLines = config.numberOfLines; + description.text = config.description; + [container setNeedsLayout]; + NSString *identifier = [NSString stringWithFormat:@"%@_%luLines", [config breakModeDescription], (unsigned long)config.numberOfLines]; + [ASSnapshotTestCase hackilySynchronouslyRecursivelyRenderNode:textNode]; + ASSnapshotVerifyViewWithTolerance(container, identifier, 0.01); + } +} + + - (void)testTextContainerInsetIsIncludedWithSmallerConstrainedSize_ASTextNode2 { UIView *backgroundView = [[UIView alloc] initWithFrame:CGRectZero]; diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testShadowing_ASTextNode2@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testShadowing_ASTextNode2@2x.png index 7a336db72..969ca3bc9 100644 Binary files a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testShadowing_ASTextNode2@2x.png and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testShadowing_ASTextNode2@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByCharWrapping_0Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByCharWrapping_0Lines@2x.png new file mode 100644 index 000000000..0d9c14053 Binary files /dev/null and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByCharWrapping_0Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByCharWrapping_1Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByCharWrapping_1Lines@2x.png new file mode 100644 index 000000000..f5a0c654d Binary files /dev/null and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByCharWrapping_1Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByCharWrapping_2Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByCharWrapping_2Lines@2x.png new file mode 100644 index 000000000..7fdf5e64a Binary files /dev/null and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByCharWrapping_2Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByCharWrapping_3Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByCharWrapping_3Lines@2x.png new file mode 100644 index 000000000..6d3acc386 Binary files /dev/null and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByCharWrapping_3Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByTruncatingHead_0Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByTruncatingHead_0Lines@2x.png new file mode 100644 index 000000000..8f72aaefc Binary files /dev/null and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByTruncatingHead_0Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByTruncatingHead_1Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByTruncatingHead_1Lines@2x.png new file mode 100644 index 000000000..e44fe36a5 Binary files /dev/null and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByTruncatingHead_1Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByTruncatingHead_2Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByTruncatingHead_2Lines@2x.png new file mode 100644 index 000000000..17aee8718 Binary files /dev/null and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByTruncatingHead_2Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByTruncatingHead_3Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByTruncatingHead_3Lines@2x.png new file mode 100644 index 000000000..f9148ef56 Binary files /dev/null and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByTruncatingHead_3Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByTruncatingMiddle_0Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByTruncatingMiddle_0Lines@2x.png new file mode 100644 index 000000000..7aa3a4908 Binary files /dev/null and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByTruncatingMiddle_0Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByTruncatingMiddle_1Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByTruncatingMiddle_1Lines@2x.png new file mode 100644 index 000000000..8516a47fa Binary files /dev/null and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByTruncatingMiddle_1Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByTruncatingMiddle_2Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByTruncatingMiddle_2Lines@2x.png new file mode 100644 index 000000000..c7751ec87 Binary files /dev/null and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByTruncatingMiddle_2Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByTruncatingMiddle_3Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByTruncatingMiddle_3Lines@2x.png new file mode 100644 index 000000000..768acf9d9 Binary files /dev/null and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByTruncatingMiddle_3Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByTruncatingTail_0Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByTruncatingTail_0Lines@2x.png new file mode 100644 index 000000000..80c209b1d Binary files /dev/null and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByTruncatingTail_0Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByTruncatingTail_1Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByTruncatingTail_1Lines@2x.png new file mode 100644 index 000000000..253a2be07 Binary files /dev/null and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByTruncatingTail_1Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByTruncatingTail_2Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByTruncatingTail_2Lines@2x.png new file mode 100644 index 000000000..b8124e674 Binary files /dev/null and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByTruncatingTail_2Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByTruncatingTail_3Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByTruncatingTail_3Lines@2x.png new file mode 100644 index 000000000..6dae954fd Binary files /dev/null and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByTruncatingTail_3Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByWordWrapping_0Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByWordWrapping_0Lines@2x.png new file mode 100644 index 000000000..9766d1a2c Binary files /dev/null and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByWordWrapping_0Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByWordWrapping_1Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByWordWrapping_1Lines@2x.png new file mode 100644 index 000000000..1b5a6d07b Binary files /dev/null and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByWordWrapping_1Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByWordWrapping_2Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByWordWrapping_2Lines@2x.png new file mode 100644 index 000000000..a69aa0bea Binary files /dev/null and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByWordWrapping_2Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByWordWrapping_3Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByWordWrapping_3Lines@2x.png new file mode 100644 index 000000000..8f1294489 Binary files /dev/null and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_firstLineHeadIndentAttribute_ASTextNode2_NSLineBreakByWordWrapping_3Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByCharWrapping_0Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByCharWrapping_0Lines@2x.png new file mode 100644 index 000000000..89dd6aaac Binary files /dev/null and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByCharWrapping_0Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByCharWrapping_1Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByCharWrapping_1Lines@2x.png new file mode 100644 index 000000000..5ffec19d9 Binary files /dev/null and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByCharWrapping_1Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByCharWrapping_2Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByCharWrapping_2Lines@2x.png new file mode 100644 index 000000000..ee5fbf008 Binary files /dev/null and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByCharWrapping_2Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByCharWrapping_3Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByCharWrapping_3Lines@2x.png new file mode 100644 index 000000000..f6a8a702f Binary files /dev/null and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByCharWrapping_3Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByTruncatingHead_0Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByTruncatingHead_0Lines@2x.png new file mode 100644 index 000000000..0274517c9 Binary files /dev/null and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByTruncatingHead_0Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByTruncatingHead_1Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByTruncatingHead_1Lines@2x.png new file mode 100644 index 000000000..23601867d Binary files /dev/null and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByTruncatingHead_1Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByTruncatingHead_2Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByTruncatingHead_2Lines@2x.png new file mode 100644 index 000000000..ecc62ca47 Binary files /dev/null and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByTruncatingHead_2Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByTruncatingHead_3Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByTruncatingHead_3Lines@2x.png new file mode 100644 index 000000000..c2d52f4a5 Binary files /dev/null and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByTruncatingHead_3Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByTruncatingMiddle_0Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByTruncatingMiddle_0Lines@2x.png new file mode 100644 index 000000000..bc2a50988 Binary files /dev/null and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByTruncatingMiddle_0Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByTruncatingMiddle_1Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByTruncatingMiddle_1Lines@2x.png new file mode 100644 index 000000000..5e90df202 Binary files /dev/null and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByTruncatingMiddle_1Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByTruncatingMiddle_2Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByTruncatingMiddle_2Lines@2x.png new file mode 100644 index 000000000..54fbae59e Binary files /dev/null and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByTruncatingMiddle_2Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByTruncatingMiddle_3Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByTruncatingMiddle_3Lines@2x.png new file mode 100644 index 000000000..f578bfa5f Binary files /dev/null and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByTruncatingMiddle_3Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByTruncatingTail_0Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByTruncatingTail_0Lines@2x.png new file mode 100644 index 000000000..d46f31427 Binary files /dev/null and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByTruncatingTail_0Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByTruncatingTail_1Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByTruncatingTail_1Lines@2x.png new file mode 100644 index 000000000..93dfe04b5 Binary files /dev/null and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByTruncatingTail_1Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByTruncatingTail_2Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByTruncatingTail_2Lines@2x.png new file mode 100644 index 000000000..69c52b0b0 Binary files /dev/null and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByTruncatingTail_2Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByTruncatingTail_3Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByTruncatingTail_3Lines@2x.png new file mode 100644 index 000000000..9b125ce47 Binary files /dev/null and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByTruncatingTail_3Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByWordWrapping_0Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByWordWrapping_0Lines@2x.png new file mode 100644 index 000000000..9afe0b414 Binary files /dev/null and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByWordWrapping_0Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByWordWrapping_1Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByWordWrapping_1Lines@2x.png new file mode 100644 index 000000000..137f94095 Binary files /dev/null and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByWordWrapping_1Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByWordWrapping_2Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByWordWrapping_2Lines@2x.png new file mode 100644 index 000000000..bff9721c3 Binary files /dev/null and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByWordWrapping_2Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByWordWrapping_3Lines@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByWordWrapping_3Lines@2x.png new file mode 100644 index 000000000..fe0d216f7 Binary files /dev/null and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTextTruncationModes_with_headIndentAttribute_ASTextNode2_NSLineBreakByWordWrapping_3Lines@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testThatDefaultTruncationTokenAttributesAreInheritedFromTextWhenTruncated_ASTextNode2@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testThatDefaultTruncationTokenAttributesAreInheritedFromTextWhenTruncated_ASTextNode2@2x.png index 18266450f..faae04ac5 100644 Binary files a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testThatDefaultTruncationTokenAttributesAreInheritedFromTextWhenTruncated_ASTextNode2@2x.png and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testThatDefaultTruncationTokenAttributesAreInheritedFromTextWhenTruncated_ASTextNode2@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTintColorHierarchyChange_green_tint_from_parent@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTintColorHierarchyChange_green_tint_from_parent@2x.png index 966591c52..7807e4ed2 100644 Binary files a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTintColorHierarchyChange_green_tint_from_parent@2x.png and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTintColorHierarchyChange_green_tint_from_parent@2x.png differ diff --git a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTintColorHierarchyChange_red_tint_from_parent@2x.png b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTintColorHierarchyChange_red_tint_from_parent@2x.png index 0d7f5ab4a..9bbd3bd67 100644 Binary files a/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTintColorHierarchyChange_red_tint_from_parent@2x.png and b/Tests/ReferenceImages_64/ASTextNode2SnapshotTests/testTintColorHierarchyChange_red_tint_from_parent@2x.png differ