Type background (see example)

Howdy all, I’m looking for a dynamic way to add block backgrounds to my text like in this example. Auto-layout sorta works but there is no way to set depth levels on the backgrounds.

As a work around, I’m manually making rectangles and scaling them (ugh).

any tips would be highly appreciated!

You can try this plugin :

Substrate for text

May be auto layout for each line can do the trick.
That way you’ll have control over the depth too,