Added ASTextNodeWordKerner support to ASTextNode

* 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 commit is contained in:
rcancro
2016-01-28 08:38:22 -08:00
parent d433205e5a
commit 7f6f2fed11
10 changed files with 38 additions and 12 deletions

View File

@@ -16,6 +16,7 @@
#import <AsyncDisplayKit/ASStackLayoutSpec.h>
#import <AsyncDisplayKit/ASInsetLayoutSpec.h>
#import <AsyncDisplayKit/ASTextNodeTypes.h>
static const CGFloat kImageSize = 80.0f;
static const CGFloat kOuterPadding = 16.0f;
@@ -128,7 +129,8 @@ static const CGFloat kInnerPadding = 10.0f;
style.hyphenationFactor = 1.0;
return @{ NSFontAttributeName: font,
NSParagraphStyleAttributeName: style };
NSParagraphStyleAttributeName: style,
ASTextNodeWordKerningAttributeName : @.5};
}
#if UseAutomaticLayout