Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text Wrapping - adding consecutive spans of text #5145

Closed
BLK-Dragon opened this issue Mar 29, 2022 · 2 comments
Closed

Text Wrapping - adding consecutive spans of text #5145

BLK-Dragon opened this issue Mar 29, 2022 · 2 comments

Comments

@BLK-Dragon
Copy link

I'm doing a bit more complex text formatting - same font (height), occasional bold/italic/color changes.

Example of what I need to achieve :
textwrap-src

This is what I get using TextWrapped for several spans of text :
textwrap-imgui
(note bold morbi word)

TextWrapped() moves cursor to upper-left corner of whole text-block.
I'd rather not re-implement whole TextWrapped function, just need to know position of red dot (in example image) to continue adding spans of text.

Or maybe proper way is to add some flag like "move cursor to after last character of text".

@ocornut
Copy link
Owner

ocornut commented Mar 30, 2022

just need to know position of red dot (in example image) to continue adding spans of text.

Even if you had it it won't work, as the "min position" of wrapping cannot be specified, which is the effect you can see on the right. This is discussed in #2313 which is the same issue.

For now it is simpler you copy the text rendering loop and adjust it to your needs.
Later we will introduce new, more complete text functions.

@BLK-Dragon
Copy link
Author

OK, I'll stick to imgui_markdown solution for now.

@ocornut ocornut closed this as completed Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants