Customize characters that count as word breaks for line wrapping

Is there any setting where I can provide additional characters that TMP can use for line breaks instead of the default white space and dashes? Ideally, I’d like to be able to tell it to use any arbitrary character (such as an underscore or an underbracket) to break on, so word wrapping still functions.

Otherwise, I think I have to inspect each line, see if it overflows, then trace back to the character in question, break the line manually, and repeat until all the text is laid out… essentially just do the layout manually. I’d much prefer to have TMP do the work…

Why are you trying to control the layout manually?

What are you trying to accomplish?

I have a string for a typing game. Spaces are being represented by visible characters - so they could be an underscore _ or underbracket ˽ … or something else, but it won’t be a natural word break that generates line breaks.

Ideally, I’d just tell TMP: “Also use character 0x02fd to break lines”.

I admit, this is a weird edge case.

Edit: I just discovered the zero-width optional breaking space (\u200B), which TMP appears to respect and it looks like I may be able to use that to solve this; I’ll just have to put it beside every one of those fake spaces and then filter them out while typing.

1 Like