Separate TextLayout result into paragraphs with ShapedTextParagraph.

Change the `Text::wrapText` implementation to use the `LineWrap::computeLineBreaks` function, so it's consistent across eepp. Also renamed the function to `Text::hardWrapText` to be more descriptive.
Added new-line support in `LineWrap::computeLineBreaks`.
This commit is contained in:
Martín Lucas Golini
2026-01-24 17:59:09 -03:00
parent baa16fe44d
commit 1789540388
13 changed files with 310 additions and 353 deletions

View File

@@ -49,11 +49,11 @@ EE_MAIN_FUNC int main( int, char*[] ) {
text.setFontSize( 24 );
text.setAlign( TEXT_ALIGN_CENTER );
text.setString( Txt );
text.wrapText( win->getWidth() - 96 );
text.hardWrapText( win->getWidth() - 96 );
// Set the font color to a substring of the text
// Create a gradient
int size = (int)Txt.size();
int size = (int)text.getString().size();
for ( int i = 0; i < size; i++ ) {
text.setFillColor( Color( 255 * i / size, 0, 0, 255 ), i, i + 1 );