- Home /
TextMeshPro to wordwrap on every character
I'm building a Command-line terminal emulator, and I want the TMPro.TMP_Text object to wordwrap on any printed character, so that my monospace font always displays 80 characters per line, regardless of what is in those lines.
Why not just add line breaks?
I can't just add line-breaks to every 80th character because there are invisible characters in the display (font-color tags, directives), multiple objects are reading and/or writing to the text (including an important one from another thread), substrings from the text are used as literals for commands, and I also need to be able to copy-and-paste accurately.
What my research found
I found a video ( https://youtu.be/uTajI2lWwgE ) about a revised implementation of wordwrapping but it doesn't show how to implement the different wordwrap system.
Leading questions
- Is there a way I can modify the TMP_Glyph data and set every character to word-wrappable as though it were whitespace?
- Is there a way to get the Layout Size Fitter to cap the allowed width of the rendering-space so that when wordwrap is disabled, the text overflows into the next line?
Answer by mvaganov · Dec 24, 2018 at 10:24 PM
Using an open <nobr> tag at the beginning of the text works... for the first line only.
Your answer
Follow this Question
Related Questions
How to only use namespace if it exists? 0 Answers
UI not working after build 0 Answers
TextMesh wordwrap 4 Answers
Textmesh Pro Input Field Rich Text 3 Answers
Scroll A Text Once It Reaches The End Of The Viewport 0 Answers