-
-
Notifications
You must be signed in to change notification settings - Fork 105
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
[Question] line breaks in textbox #325
Comments
Thanks for the issue, this should now be fixed! |
Hey, I had a look at the textbox wrap handling, while the change did ensure more words fit on a single line, it had a side effect where occasionally, the text would overflow textbox width, causing some overlaps with other elements. However, I tried to figure out what exactly has changed the line break behavior in the first place and I feel like f1581cb#diff-55d9a4bda7ac820feb7545bb7c241602a510d8ddcc5598a03c60f147eaf21b1bR296 was the change since when these edge cases (mentioned in the original post) started to occur. Reverting back to a linebreak.go from before this commit revision got me back to old renders, where line breaks still happened more naturally. |
Yes, but that would undo the change above and the problem of your previous post would reappear, doesn't it? It is true that the commit you reference is a custom addition to the algorithm and is not part of the original, but the original doesn't handle all cases correctly as far as I can see. I believe the problem you describe is mostly in combination with literal line breaks. I'll try and reproduce the problem and see if it can be fixed. |
True, the change above might still be beneficial in the long run, I have not tested a combo of having this change applied with the custom addition from commit above reverted, maybe there's a wiggle room in there we could work with. In fact the line breaks do appear to be more natural with the change you made, but sadly the overlap issue prevents us from going that route. I agree, could be a combo of changes causing this issue. Thank you for looking into it! |
This should now be fixed, I've added tests so that we don't see regressions anymore. |
Hey,
we've recently updated canvas and have noticed few improvements, however there are still some edge cases (that were also present in older iterations) that we aren't sure about and it feels like the line breaks don't seem to behave correctly.
Here's a demo image:
![D6DMemnHoD](https://private-user-images.githubusercontent.com/9026786/388892127-d1dd0401-72a6-4652-ba9a-9138f7b313fd.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4NTA2MDMsIm5iZiI6MTczODg1MDMwMywicGF0aCI6Ii85MDI2Nzg2LzM4ODg5MjEyNy1kMWRkMDQwMS03MmE2LTQ2NTItYmE5YS05MTM4ZjdiMzEzZmQucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDZUMTM1ODIzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YWEwMDVhMjcxMmY5MDA0ZjZhNmY0ZDUzZmU0N2YzZmZjNTEwYmYwYjU2YTkwZDY1NTQxNzRlOTZmM2ZmMzZjZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.n-0AOg5BsZo0YazI-_U2tV4qsR5TxzN80qc56aJBDsg)
To me it feels like the first highlighted sentence could contain a few more words than it does right now. I've tried removing the comma, that does not seem to have any effect at all either. If this works as intended, I'd like to ask for some clarification for why this edge case happens,
Here is an isolated demo with the textbox above being rendered:
linebreaks.zip
Note the demo currently uses a fork of your font repo (matches master), because of an issue we've opened just recently: tdewolff/font#5. Otherwise the demo would panic while loading the provided font.
The text was updated successfully, but these errors were encountered: