I'm trying to use THLabel to create a solid white background around my label that follows the shape of the text. It looks fine mostly, but some letters can cause holes in the stroke's shape, which makes it a bit ugly.
The following image shows the problem with the letter 'i':
Hi!
I'm trying to use THLabel to create a solid white background around my label that follows the shape of the text. It looks fine mostly, but some letters can cause holes in the stroke's shape, which makes it a bit ugly.
The following image shows the problem with the letter 'i':![IMG_EC9B0D7411C0-1](https://user-images.githubusercontent.com/2576246/72247406-7ab67f80-35fd-11ea-99f0-0b3a28251e79.jpeg)
And the desired output would be:![IMG_2EB23E5F7DC1-1](https://user-images.githubusercontent.com/2576246/72247405-7a1de900-35fd-11ea-818e-99e216baf5ad.jpeg)
I've come up with a temporary solution, but it's probably not the most optimal. In the
strokeImageWithRect
function I've applied a 1px white shadow on the clipping mask, then used this idea to "remove" the opacity of the blurred shadow edges: https://stackoverflow.com/questions/14622202/can-cgcontextcliptomask-mask-all-non-transparent-pixels-with-alpha-1I wonder if there's any better way of filling the holes directly on the clipping mask's path, without using a shadow.