Overflow Y Hidden
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.
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?
@pulimoodan
Your solution to clipping the overflow seems good to me.
I have one question, Is there an option to supply font color?
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).