Closed emcmanus closed 11 years ago
Thanks, looking into it.
I pushed a fix to the dev branch.
Petr, that must be a record for issue turn-around time. Thanks so much. :smiley:
This certainly solves the test case, but I'm still having issues with a label returning NSNotFound when numberOfLines is 0. Let me poke around for a bit to see if I can either narrow down the conditions for failure or patch the issue.
But I really appreciate the fast response!
Hey, no problem and thanks for trying PPLabel :-). I merged the changes into the master branch so I'm about co close this issue.
About the number of lines issue, the code you pointed at should be executed only if the provided string is empty. Could you open another issue and send me the attributed string that does not work for you? Thanks.
Hey Petr, looks to be an issue outside of PPLabel. We're using a custom font and somehow the framesetter and textRectForBounds disagree on the frame size needed to render the attributed string.
As a result, the frame passed to CTFramesetterCreateFrame is 1px too short, and the resulting CTFrameGetVisibleStringRange is [0, 0]. (CTFrameGetStringRange returns the expected [0, length].)
Attributed text instances must currently specify a paragraph style, or else PPLabel will crash in this enumeration block.
A simple test case is to add the following to the example project's ViewController.m#viewDidLoad: