Replies: 3 comments
-
I tried to copy |
Beta Was this translation helpful? Give feedback.
-
You can (and may have to) query the underlying go-text library as that information is returned by the shaping run. I don't even know how we would expose this as wrapping is highly context sensitive so any query to this state would somehow have to go through a text widget's renderer I think..? |
Beta Was this translation helpful? Give feedback.
-
Yeah I'm doing work in a custom renderer right now. I wouldn't suggest it makes sense to actually expose this in the API, it's a weird request, but it's something I need to make my app look as good as it can, so I'm curious to see what I can do. Probably that means re-computing the word wrapping an extra time in my code just for this (if that doesn't end up being too expensive). I see the shaping library used down in If I do pursue this I think I might do something like split the last line into chunks of text plus their leading whitespace
then measure and store the length of each segment with That'd be a lot of work! But it should be accurate. I tried a jankier |
Beta Was this translation helpful? Give feedback.
-
Is it possible to determine what the last row of wrapped RichText is via the API, such that I can
fyne.MeasureText
just that part of it? I'm trying to neatly pack some widgets into a chat bubble, and when I'm wrapping it would be quite useful to know how much space I'm using on that last line so I can check if I have room to put icons there without making the bubble bigger.Beta Was this translation helpful? Give feedback.
All reactions