* Added a member to `ASTextKitAttributes` that is an optional delegate to the struct's NSLayoutManager.
* Changed ASTextNode to set this delegate to an instance of ASTextNodeWordKerner.
* Updated init method of `ASTextKitContext` to take an optional NSLayoutManager delegate
* Added the files in TextKit folder to the public headers (so we can include ASTextNodeTypes.h)
This patch switches to instance methods of draw and display for
ASTextNode and ASImageNode to attempt to increase their performance.
It also fixes some thread safety issues in ASImageNode which appear
to have been regressions (though probably not hit very often).
And it sets up work for allowing modification of CGContexts before
and after a node's contents are drawn.
Actually it is possible that truncated string is longer then original
string.
For example, original string:
```
hello
this is
very long
message here
and there
```
with maximumNumberOfLines=4, truncationAttributedString = ' ...' and
additionalTruncationMessage = 'read more'
will give
```
hello
this is
very long
message here ... read more
```
So `[attributedString attribute:attributeName atIndex:characterIndex
longestEffectiveRange:&range inRange:visibleRange]` will crash.
This allows the change in size for the NSTextContainer to occur off the main thread, whenever that size change
is necessary. Then the text relayout can occur earlier, during the process of computing ASLayoutSpecs.
Fix ASTextNode truncated size calculation ignoring attributes in the last line, by syncing the truncationString's attributes with the primary attributedString.
This should not directly affect more complex apps that don't use the ASBasicImageDownloader.
Also disables the default-on text placeholders, as they churn memory during the measurement pass.
These were intended to be written with pure layers (without using backing stores), so I don't
think it is a reasonable default-on behavior until that is fixed.
1) Set the ascender/descender of an ASTextNode when the attributeString is set. Previously ascender/descender were only being computed in `setValuesFromLayoutable` and only when the attribute string was not nil. May make sense to remove the computation from `setValuesFromLayoutable` entirely.
2) Remove ability to allow different children of a stack spec to aling to different baselines. This wasn't working before and I'm not convinced it is possible to do properly/useful enough to invest the time.
3) Have all stack spec run `ASStackBaselinePositionedLayout::compute` to compute the stack's ascender and descender. Even if the stack isn't aligning its children to a baseline, the stack itself may be a child of another stack that IS aligning to a baseline.