Closed sry948749099 closed 1 year ago
Hi @sry948749099,
Yes, see https://mgeisler.github.io/textwrap/ for an example where Textwrap is used to wrap text based on pixels.
The important part is this implementation of Fragment
. The Fragment
trait is what Textwrap uses when wrapping: you should implement it for your own custom type and then you'll be able to use all the wrapping algorithms on this type.
Hi @sry948749099,
Yes, see https://mgeisler.github.io/textwrap/ for an example where Textwrap is used to wrap text based on pixels.
The important part is this implementation of
Fragment
. TheFragment
trait is what Textwrap uses when wrapping: you should implement it for your own custom type and then you'll be able to use all the wrapping algorithms on this type.
Get it! Thanks for your quickly respose!
Is there a way to wrap lines in pixels instead of bytes?