mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-02-06 11:27:43 +00:00
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:
@@ -28,6 +28,7 @@
|
||||
exclusionPaths:(NSArray *)exclusionPaths
|
||||
constrainedSize:(CGSize)constrainedSize
|
||||
layoutManagerFactory:(NSLayoutManager*(*)(void))layoutManagerFactory
|
||||
layoutManagerDelegate:(id<NSLayoutManagerDelegate>)layoutManagerDelegate
|
||||
{
|
||||
if (self = [super init]) {
|
||||
// Concurrently initialising TextKit components crashes (rdar://18448377) so we use a global lock.
|
||||
@@ -37,6 +38,7 @@
|
||||
_textStorage = (attributedString ? [[NSTextStorage alloc] initWithAttributedString:attributedString] : [[NSTextStorage alloc] init]);
|
||||
_layoutManager = layoutManagerFactory ? layoutManagerFactory() : [[NSLayoutManager alloc] init];
|
||||
_layoutManager.usesFontLeading = NO;
|
||||
_layoutManager.delegate = layoutManagerDelegate;
|
||||
[_textStorage addLayoutManager:_layoutManager];
|
||||
_textContainer = [[NSTextContainer alloc] initWithSize:constrainedSize];
|
||||
// We want the text laid out up to the very edges of the container.
|
||||
|
||||
Reference in New Issue
Block a user