(for context, I studied linguistics, mainly Persian; and I build writing tools)
One of the tools I'm making renders text in multiple fading lines (i.e. the text fades as you keep writing). After hours and hours of dealing with BIDI my users are mostly happy with the UX... but I still have my nemesis left:
• in some calligraphy styles, e.g. nastaliq words are not aligned with a single line, but a series of "waves" for each segment (compare kufi or thuluth and nastaliq, diwani (ok, diwani's a bit extreme))
• how can I easily shade each line of actual text? so that a line doesn't peek out of it or doesn't get cropped? How would one shade text written in nastaliq?
for Latin and most supported languages, text normally doesn't exceed the line-height, so it's fairly easy to apply a mask without getting into the text composition/layout rabbit hole.
If you have any tips - I'll take anything (I've tried a lot of approaches, but I'm just a sample of one, with only one thought-sponge/monkey brain to solve this)