How to set edge style on UILabel text

731 views Asked by At

I'm working on adding custom captions to my iOS app that plays videos. I'd like to support all the features of CEA-708 (which are essentially rich-text captions), but I can't figure out how to apply the necessary edge-styles using a UILabel.

The image below shows the edge styles I want to support. However, I am struggling to find a way to achieve raised/depressed edges. Any ideas?

CEA-708 caption font edge styles

1

There are 1 answers

1
Zeb On

I don't think that those behaviors are expected in iOS. The only idea that I can suggest is to use two labels to achieve those effects, with different z-indexes and positions and colors to obtain the offset similar to the edge. Otherwise, you can try to take a look to this link https://developer.apple.com/library/ios/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_shadows/dq_shadows.html.