-
-
Notifications
You must be signed in to change notification settings - Fork 561
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
Small problem with some font descenders #38
Comments
Glad you find it useful! Well in general, MarqueeLabel doesn't mess too much with the height or Y positioning of the UILabels it wraps. It is possible to set the frame height too small for the font size you're using though, and you'll end up cutting off the bottom. If you use a regular UILabel, with the same frame size, font size, etc, do you see the same problem? |
Any luck? I'd be interested in seeing a code sample of the setup that's causing your issue if you haven't found out a solution. |
Going to go ahead and close this out - let me know if my above comments didn't fix it! |
My UILabel is big enough to avoid this descender problem when I don't use MarqueeLabel, but when I do use it the letters get cut off (e.g. g) whenever the label is labelized (i.e. if it's animating the marquee the letters are not cut off). Even if I make the UILabel way bigger than necessary, after labelizing the letters get cut off. Using FuturaStd-Medium Note my workaround for this is typically either to make the label bigger than necessary using AutoLayout (not working here because of MarqueeLabel) or to use insets (made simple using a custom subclass like this). |
@simonbromberg Hmm I just tried it in the demo project, changed the font of the first label to Futura Medium in IB and (probably) oversized the label, and didn't see the issue - could you be more specific on the configuration and/or set up a test case? Side note - what do you mean by AutoLayout and not working because of MarqueeLabel? |
I am not using the built in Futura Medium font but rather a custom one (although I have seen this kind of issue with built-in fonts before). Re side note: As I mentioned, when the MarqueeLabel is animating, the letters are not cut-off, but when it labelizes it cuts off the letters. I suspect this is because the UILabel it uses internally is sizes using sizeToFit which can trump the constraints in IB. |
Well MarqueeLabel actually uses sizeThatFits, not sizeToFit, which doesn't inherently resize the view upon the call to that function. But that's probably irrelevant, because it does "manually" resize the sublabel frame to be equal to it's own However, I did just notice that the Do you happen to be using the |
Is Possibly also relevant that I am using attributed strings. |
If you use MarqueeLabel in such a way that it's easy to modify the code quickly, you could try changing this line to: homeLabelFrame = CGRect(x: leadingBuffer, y: 0.0, width: expectedLabelSize.width, height: bounds.size.height).integral Or for Objective-C, this line to: self.homeLabelFrame = CGRectIntegral(CGRectMake(self.leadingBuffer, 0.0f, expectedLabelSize.width, self.bounds.size.height)); Or alternatively/more easily, temporarily change your label's |
I've pushed release 3.0.5 - let me know if it fixes the issue for you! |
@simonbromberg did you get a chance to test the latest release? I'm thinking it probably corrected the issue. |
I wound up modifying the descender/ascender of the font a bit. I'll have to go back into the commit history and test it from before that change when I get a chance. |
I'm thinking my change may have fixed it, so I'm going to (re)close this issue, but if you do check it and find the problem is still there please post again and I'll reopen! |
Hi, first, thanks for a terrific control.
I find that it cuts off some font descenders (Futura for example). These are not custom fonts, in that they are part of iOS.. Maybe it's a system problem. But I thought you should be advised.
I have seen this post describing a similar problem with custom fonts:
http://www.andyyardley.com/2012/04/24/custom-ios-fonts-and-how-to-fix-the-vertical-position-problem/
If there is a workaround, please let me know.
The text was updated successfully, but these errors were encountered: