New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Text Clipping #18
Comments
whoops, Got it, nvm setTextInsets did the job |
I've worked upon your last pull request and came up with a logic for sizeThatFits (because you shouldn't override sizeToFit) that conforms to the available Core Text frame. Could you please test my newest commit if this works for you? There's also a new property called |
I tried it out, It works in some places, but in others it sets the frame too small. The text gets shortened at the end with ... These same labels were sized properly earlier |
Alright thanks for testing. I guess I'll have to do more testing myself. But in your case you're "only" using outside stroke, is that right? |
Yup, just strokeColor and strokeSize. |
Is there any way you could tell me which (probably custom) font you're using at which font size? I'm not able to reproduce the issue. :/ |
I'm using the font Damn Noisy kids, available at http://www.dafont.com/damn-noisy-kids.font |
I've commited a fix, but it wasn't even font-related. If it's still producing truncated strings, I'm not sure what the issue is. |
Nope, Still producing truncated strings, in more places than before. |
I'm so confused. If you could provide a minimal example project and send it to tobias.hagemann@gmail.com, that would be great. It's okay if you don't have the time, but I don't know how/what to test anymore, because I can't reproduce the issue. |
The current code is actually crashing on line 435 now I'll send you a sample project on your email to reproduce the issue |
Hey did a little trial and error and I think the string is getting truncated while using AutoLayout. Wasn't able to reproduce the issue in a separate project without it |
I've commited a fix for intrinsicContentSize, I guess the sizing behavior is different with Auto Layout. Now I'm rounding up the numbers. But I'm not sure about that crash. |
Yup that did it! Everything looks perfect now. Not sure what that crash is either, not consistently reproducible. |
My guess is that I'm using CFRelease too soon on some things, but I thought it's common practice to use CFRelease after using CFCreate. Just went through the code again and couldn't find anything specific. Crashing is bad though, it worries me a bit. |
So from what I have observed, the crash is occurring when layoutIfNeeded is being called and the label is being redrawn and the text is nil on line 438. The same issue is not observed on regular UILabels even if the text string is nil. |
Whoops! Fixed that with version 1.4.1! Thanks for helping me out! I guess that's it? :D |
Yup, looks solid! Thanks for the awesome Label !! :) |
Thanks again for testing and giving feedback! |
Hi,
I'm getting some clipping around the text with the font I'm using
I updated the sizetofit method on THLabel but it removes the clipping only on the right hand side
The issue is only visible when using sizeToFit. I have faar to many labels to manually set the frames for them. Any suggestions?
The text was updated successfully, but these errors were encountered: