I am afraid that your proposed approach of using setShadowLayer() will not work, as this approach effectively draws a second TextPaint with blur.
Putting several text labels on top of each other essentially means that you need to compensate for it by 1 pixel for each step, which is very graphically intensive and will have very low performance.
This is a great question and a real challenge!
The only solution that comes to mind is to process each glyph independently, checking all the elements of the path and expanding the shadow between the farthest left and top right points. It seems very complicated, and I donβt know if there is any mechanics in the SDK that facilitates this approach.
Recommended reading:
- This question decides to get glyph paths from TTF.
- This answer illustrates how you can use path usage , although this pertains to the JavaScript approach.
Paul lammertsma
source share