UILabel: NSShadow displacement does not honor text resizing
| Originator: | daniel | ||
| Number: | rdar://13411181 | Date Originated: | 13-Mar-2013 07:09 PM |
| Status: | Duplicate of 13128850 | Resolved: | 11-Apr-2013 |
| Product: | iPhone SDK | Product Version: | 6.1 |
| Classification: | UI/Usability | Reproducible: | Always |
Summary:
When using iOS 6’s attributed text on UILabel to define a text shadow, and setting the label to shrink its text if it would not fit, the text shadow that is drawn clings to baseline of the un-shrunken text.
In addition, the shadow is not scaled down, either. Instead, it is drawn in the unadjusted font.
Steps to Reproduce:
1. Create a label that scales down its text if it doesn’t fit.
2. Set the attributed text to something like this*:
14.999.259 €{
NSColor = "UIDeviceWhiteColorSpace 0.25 1";
NSFont = "<UICFFont: 0x17043650> font-family: \"HelveticaNeue-Medium\"; font-weight: normal; font-style: normal; font-size: 24px";
NSKern = 0;
NSLigature = 0;
NSParagraphStyle = "Alignment 2, LineSpacing 0, ParagraphSpacing 0, ParagraphSpacingBefore 0, HeadIndent 0, TailIndent 0, FirstLineHeadIndent 0, LineHeight 0/0, LineHeightMultiple 0, LineBreakMode 4, Tabs (\n 28L,\n 56L,\n 84L,\n 112L,\n 140L,\n 168L,\n 196L,\n 224L,\n 252L,\n 280L,\n 308L,\n 336L\n), DefaultTabInterval 0, Blocks (null), Lists (null), BaseWritingDirection -1, HyphenationFactor 0, TighteningFactor 0, HeaderLevel 0";
NSShadow = "NSShadow {0, 1} color = {UIDeviceWhiteColorSpace 1 1}";
}
*this is the description of the NSAttributedString in use.
3. Constrain the label’s width to less than the preferred width for this string.
Expected Results:
The text, and its shadow are displayed nicely.
Actual Results:
The shadow is rendered in the unscaled font, offset from the unadjusted baseline
Regression:
Didn’t work on 6.0, either :-(
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!