It's not really elegant, will trim ending ']' from QTF if it's there, so that should be added after trimming. However with the width given correctly it works pretty good. Uploading image of output.
Will try to implement the way you suggested when I can do some optimisation.
With GetHeight, you would not need to specify width...