{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/462","labels_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/462/labels{/name}","comments_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/462/comments","events_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/462/events","html_url":"https://github.com/facebook/AsyncDisplayKit/pull/462","id":79579547,"number":462,"title":"Possible fix for text node truncation issue","user":{"login":"lxcid","id":297156,"avatar_url":"https://avatars.githubusercontent.com/u/297156?v=3","gravatar_id":"","url":"https://api.github.com/users/lxcid","html_url":"https://github.com/lxcid","followers_url":"https://api.github.com/users/lxcid/followers","following_url":"https://api.github.com/users/lxcid/following{/other_user}","gists_url":"https://api.github.com/users/lxcid/gists{/gist_id}","starred_url":"https://api.github.com/users/lxcid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lxcid/subscriptions","organizations_url":"https://api.github.com/users/lxcid/orgs","repos_url":"https://api.github.com/users/lxcid/repos","events_url":"https://api.github.com/users/lxcid/events{/privacy}","received_events_url":"https://api.github.com/users/lxcid/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/labels/CLA%20Signed","name":"CLA Signed","color":"bfe5bf"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-22T19:31:57Z","updated_at":"2015-06-14T01:00:27Z","closed_at":"2015-06-14T01:00:27Z","pull_request":{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/462","html_url":"https://github.com/facebook/AsyncDisplayKit/pull/462","diff_url":"https://github.com/facebook/AsyncDisplayKit/pull/462.diff","patch_url":"https://github.com/facebook/AsyncDisplayKit/pull/462.patch"},"body":"This fix is related to #261.\r\n\r\nFirst, the issue seems to originate from `ASTextNodeWordKerner` which is set as the `NSLayoutManager`'s delegate. If you prevent it from being the layout manager's delegate, rendering will work correctly.\r\n\r\nDigging deeper, it seems like we are checking for the wrong glyph property.\r\n\r\nInside the code, we seems to be trying to search for whitespaces so that we can check its glyph property. The problem is that we are checking for `NSGlyphPropertyControlCharacter`.\r\n\r\nIn the documentation `NSGlyphPropertyControlCharacter` is described as follows:\r\n\r\n> Control character such as tab, attachment, and so on, that has associated special behavior.\r\n\r\nIt seems like there's a mismatch here. Whitespaces are usually described with `NSGlyphPropertyElastic`. This is checked against the documentation...\r\n\r\n> Glyphs with elastic glyph width behavior such as whitespace.\r\n\r\n... and check against the original provided glyph property with something like this in the method...\r\n\r\n```Objective-C\r\n    NSGlyphProperty glyphProperty = properties[arrayIndex];\r\n    switch (glyphProperty) {\r\n        case NSGlyphPropertyNull: {\r\n            NSLog(@\"NSGlyphPropertyNull\");\r\n        } break;\r\n        case NSGlyphPropertyControlCharacter: {\r\n            NSLog(@\"NSGlyphPropertyControlCharacter\");\r\n        } break;\r\n        case NSGlyphPropertyElastic: {\r\n            NSLog(@\"NSGlyphPropertyElastic\");\r\n        } break;\r\n        case NSGlyphPropertyNonBaseCharacter: {\r\n            NSLog(@\"NSGlyphPropertyNonBaseCharacter\");\r\n        } break;\r\n    }\r\n```\r\n\r\nI'm unsure under what circumstances will whitespaces not describe as `NSGlyphPropertyElastic` by the system, thats something to ponder too.\r\n\r\nHope this help!"},"comment":{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/comments/111766322","html_url":"https://github.com/facebook/AsyncDisplayKit/pull/462#issuecomment-111766322","issue_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/462","id":111766322,"user":{"login":"appleguy","id":565251,"avatar_url":"https://avatars.githubusercontent.com/u/565251?v=3","gravatar_id":"","url":"https://api.github.com/users/appleguy","html_url":"https://github.com/appleguy","followers_url":"https://api.github.com/users/appleguy/followers","following_url":"https://api.github.com/users/appleguy/following{/other_user}","gists_url":"https://api.github.com/users/appleguy/gists{/gist_id}","starred_url":"https://api.github.com/users/appleguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appleguy/subscriptions","organizations_url":"https://api.github.com/users/appleguy/orgs","repos_url":"https://api.github.com/users/appleguy/repos","events_url":"https://api.github.com/users/appleguy/events{/privacy}","received_events_url":"https://api.github.com/users/appleguy/received_events","type":"User","site_admin":false},"created_at":"2015-06-14T01:00:27Z","updated_at":"2015-06-14T01:00:27Z","body":"@lxcid thanks for researching this, and it was really great to meet you at the Pinterest WWDC party :).\r\n\r\nIt does look like this is a bit more complicated than this diff can address right now, so I'm going to keep the task open (and reference this diff) but close the PR.  There is a possibility of integrating a slightly newer text layout system from ComponentKit that is likely to fix some corner cases like this."}}