An example: the text "Hello There إلا بسم الله Beep Boop!!" should turn into two visual lines as follows if it is line-wrapped:
Hello There إلا
بسم الله Beep Boop!!
Notice how "إلا" goes from the fifth word (from left to right) to the third after the line wrap. This won't work if shaping happens before line wrapping.
Is this the case if all the text is in Arabic? Or if all the text was in Arabic, could layout be done after shaping?