mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-08-18 06:55:48 +03:00
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:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user