The text layer gets a legibility scrim (linear gradient) for the background with these stops:
0.0: Transparent
0.6: Transparent
1.0: Off-black color at 80% opacity
Why off-black? https://lickability.com/blog/plussing-your-ios-app/#-elevating-aesthetics-with-color-grading
Lastly, a text shadow for a final layer of defending your design against poor contrast. We use the same color as the legibility scrim for the shadow. You want the shadow to be sharp enough so it remains close to the letter shape, but not so sharp that it looks embossed.