I’m trying to make text go around an image like in the examples above. It would be easy if the text wrap functionality would spit out how many lines the text has been wrapped but I don’t think that’s a feature.
I’ve also tried measuring and breaking text when found out of widget borders and it works but UMG needs one frame to update positions so I can render the text 1 frame per world which doesn’t look nice at all.
I’m having this exact problem… Did you ever find a fix? It seems so trivial, but the internet hasn’t found an answer. I thought maybe a decorator class, but I don’t know how those really work and couldn’t get it to work. I don’t technically want it “inline” with the text. Just wrap it like you have.
Text layout is actually quite hard; there’s no code that “just does it.” There are literally hundreds of pages of code in tools like InDesign and Quark Xpress, as well as in every web browser, to deal with this problem.
There’s no built-in widget in Unreal that does this. You will have to write your own custom widget in C++ that does text drawing with “exclusion” areas.
The good news is that, if all you need to do is exclude a top-left rectangle like this, the work to do is significantly simplified. You may be able to start with the multi-line widget code, and make your own sibling class of that that just has a “size of top-left exclusion” parameter, and do the appropriate layout when drawing.
I could give this a swing in blurprint.
having worked on software that does it before def helps…
The premise is fake it in ue4, because it is much, much easier.
Make the text parameter a variable.
Make the exclusion area by adding in several textboxes.
all the text boxes in the widget part will take the text from the Text variable and decide how to clip it in order to maintain the proper flow.
Things that help are variables based on character count.
if you can get the total cbaracters displayed by a texbox the clipping of the text string becomes trivial.
you may need C++ for that - as it stands I do not know if it is an exposed variable or if it is something one can use pure blueprint to figure out.
Obviously you can use base mathemarical model of em over character size to determine a custom value you decide. The thing is this all has to be dependent on the actual font, and therefore the built in methods that already do this are probably going to produce better results.