Shadow attribute is not applied consistently when drawing strings into a flipped view on OS X 10.11

Originator:peter.maurer
Number:rdar://26554358 Date Originated:
Status:Open Resolved:
Product:OS X Product Version:10.11.5
Classification: Reproducible:Always
 
SUMMARY:

When drawing a string into a flipped view (e.g., via -[NSString drawInRect:withAttributes:]), any shadow attribute set via NSShadowAttributeName is ignored depending on a couple of factors, such as…

- the string's contents
- the string being truncated


STEPS TO REPRODUCE:

Build and run the attached sample project, NSShadowAttributeNameTest, which draws the same strings with the exact same attributes into a custom view (top) and a flipped subclass instance (bottom).

(Alternatively, instead of building the sample project, just have a look at the attached screenshot, missingshadows.png, which has all the relevant information.)


EXPECTED RESULTS:

All strings should be drawn with a green shadow in both views.


ACTUAL RESULTS:

The non-flipped view behaves as expected.

The flipped view, however, skips the shadow for the emoji, as well as the truncated string. (Resizing the window to make the truncated string fit in its entirety makes its shadow appear.)


NOTES:

While emoji and other kinds of non-ASCII characters seem to trigger the bug directly, the ellipsis character doesn't appear to be the culprit in the truncated string's case, as demonstrated by the "Not…truncated." test string.

This bug is new in OS X 10.11. (First spotted in 10.11.4, but it might have been around since 10.11.0.)


--


Sample project: <https://manytricks.com/radar/26554358/NSShadowAttributeNameTest.zip>
Screenshot: <https://manytricks.com/radar/26554358/missingshadows.png>

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!