-
Notifications
You must be signed in to change notification settings - Fork 49
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
Overflow Y Hidden #83
Comments
Based on the current font style, text, and preferred width, I think we should be able to calculate the minimum height of the text box. |
Have we not already provided the height of the text box? It would be useful if there was a setting to stop text displaying outside the box, I guess like the css overflow hidden property |
Height calculation is really easy, I'm still unsure how the effect should be. Any inputs @Pelican104 @jiakuan ? |
I was imagining exactly what you have shown in option A. |
For my use case, I normally pre-calculate the text box based on the text content/style and preferred width, and then draw text exactly in the text box. In case of the text box is too small, perhaps we could provide a configuration, like CSS, e.g. overflow: visible or hidden, which means either the Current (visible) or Option A (hidden), not sure if Option B is useful in some scenarios or not. |
Hey, I think I have the solution for this. May be I can make pull request. I have one question, Is there an option to supply font color? |
Your solution to clipping the overflow seems good to me.
Not currently, but in #95, I have added color support for individual words in the text. 😄 |
I would like to have another option, to truncate the text instead of hiding the overflow (as also already asked in #91). |
Originally requested here: geongeorge/Canvas-Txt#83 By default, text overflows. Set to `false` to clip the text to the specified box.
Originally requested here: geongeorge/Canvas-Txt#83 And fix proposed here: geongeorge/Canvas-Txt#94 By default, text overflows. Set to `false` to clip the text to the specified box.
Originally requested here: geongeorge/Canvas-Txt#83 And fix proposed here: geongeorge/Canvas-Txt#94 By default, text overflows. Set to `false` to clip the text to the specified box.
This is very impressive.
Is there a way to stop text spilling out of the text box bounds?
If i provide too much text or increase the font size too much the text is spilling out of the text box at the top and bottom.
The text was updated successfully, but these errors were encountered: