Canvas-Txt
Canvas-Txt copied to clipboard
Fit text on N lines
Hi @geongeorge
I know this library is probably not maintained anymore but I'm happy to pay for your time.
In your opinion, would it be a lot of work to add an option to force the content on 1 line (or N lines)? So when the width exceeds 1 line, the font size becomes smaller so the text still fits on that one line.
@geongeorge any feedback on this? :)
@PoeHaH Sorry for the delay. I was busy with a few other things.
Currently, we recognize all line breaks and try to fit text accordingly. How would you suggest having a "fit to n lines" work with this? Should we ignore linebreaks?
I mean, instead of the text going out of bounds (like the example image attached), it would decrease the font size so it stays inside the bounds. Is that possible?
How is this issue?
@PoeHaH @agenciadw This is something that makes total sense. I will try to fit this in the 4.0.0 release
@PoeHaH @agenciadw This is something that makes total sense. I will try to fit this in the 4.0.0 release
Thank you.
I would love if you guys can provide some input here @PoeHaH @agenciadw : https://github.com/geongeorge/Canvas-Txt/issues/77
You can now do this with splitText
and only rendering that fit into your height
drawText returns the heigth now