SFML community forums

General => SFML development => Topic started by: Hapax on August 13, 2023, 06:02:22 pm

Title: Multi-line Text Alignment
Post by: Hapax on August 13, 2023, 06:02:22 pm
Would you be interested in having a simple multi-line alignment for sf::Text?

You may or may not have already seen this:
https://github.com/Hapaxia/SfmlTextAline
where I created something similar to sf::Text that also included a multitude of alignment features.

However, I'm proposing a simple "Left/Center/Right/Justify" choice that would simply affect the entire text globally.
Maybe not even justify if you'd prefer not to have that since it would depend on the type of justification you'd want: "word" justification or "character" justification where "word" only stretches spaces and "character" also separates characters. Of course, you could have both as an option.

The left/center/right option is pretty simple to implement so I'd guess you'd prefer that, if this is a consideration at all, of course.

Let me know and I'll start up a draft...
Title: Re: Multi-line Text Alignment
Post by: Thrasher on August 18, 2023, 07:15:03 pm
The ability to wrap text and pick left, right, center, justified alignment would be really nice since as it stands now users are forced to do all that themselves which understandably scares people away from using blocks of text.
Title: Re: Multi-line Text Alignment
Post by: Hapax on August 18, 2023, 09:58:17 pm
Do you think I should target it for SFML 3 (so it's available from 3 onwards) or 2 (so it's available now)?
Title: Re: Multi-line Text Alignment
Post by: Thrasher on August 19, 2023, 06:42:19 am
SFML 3. We're not accepting SFML 2 features anymore. That means you have full access to anything you want from C++17 which should make it easier to implement.
Title: Re: Multi-line Text Alignment
Post by: Hapax on August 20, 2023, 12:53:05 pm
Okay; thanks! It shouldn't take much implementation anyway so shouldn't need any spectacular C++17 features ;D
Title: Re: Multi-line Text Alignment
Post by: Thrasher on August 21, 2023, 09:01:23 pm
Please reach out in the #contributing channel of the Discord server if you have any questions. I'm much easier to find there than on the forums which I check much less often.
Title: Re: Multi-line Text Alignment
Post by: Hapax on August 22, 2023, 11:35:36 am
Sure thing!

I keep forgetting to open Discord. Oops.