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

Skia: word-wrap and elide doesn't work #5318

Open
frankalex92 opened this issue May 29, 2024 · 1 comment
Open

Skia: word-wrap and elide doesn't work #5318

frankalex92 opened this issue May 29, 2024 · 1 comment
Labels
a:renderer-skia Skia Renderer (mS) a:text Text rendering, fonts, Text input (mS,bF) bug Something isn't working

Comments

@frankalex92
Copy link

frankalex92 commented May 29, 2024

It seems that the property "wrap: word-wrap" does not function as intendet when using winit-skia.

I am using 1.6.0 and have features renderer-skia-opengl and gettext set.

The string wraps at the boundaries of my Text-Component as intended:
image (2)

But when setting the env-var:
export SLINT_BACKEND='winit-skia'
and starting again it won't:
image (1)

I am using the gettext function for translations, but I checked and this is also happening when i put the long string directly into my Text-Component, so shouldn't be connected to the translations.

Here are all the properties set:
WhatsApp Image 2024-05-29 at 15 55 20

I have overflow:elide and wrap:word-wrap set together, maybe that's causing problems, altough without skia works nicely, wraps at line end and overflows on vertical space:
WhatsApp Image 2024-05-29 at 15 57 34

BR

@FloVanGH FloVanGH added bug Something isn't working a:renderer-skia Skia Renderer (mS) labels May 29, 2024
@ogoffart ogoffart added the a:text Text rendering, fonts, Text input (mS,bF) label Jun 4, 2024
@ogoffart
Copy link
Member

ogoffart commented Jun 4, 2024

I can reproduce.

Testcase:

export component StatusBox inherits Window  {
    preferred-width: 100px;   preferred-height: 100px;
    min-height: 64px;   min-width: 64px;

    Rectangle {
         height: 100%;
         width: 100%;

         Text {
             text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
             height: 100%;
             width: 100%;
             wrap: word-wrap;
             overflow: TextOverflow.elide;
         }
     }
 }

image

Note that some work has already be done since issue #3481 but there is still many inconsistencies between renderer. One small issue with the software renderer is tracked in #3695 , but this issue with skia seems more problematic.

@ogoffart ogoffart changed the title word-wrap doesn't work when using winit-skia backend Skia: word-wrap and elide doesn't work Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:renderer-skia Skia Renderer (mS) a:text Text rendering, fonts, Text input (mS,bF) bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants