Skip to content
Discussion options

You must be logged in to vote

The logic to break text into pieces that fit in the given rectangle width, roughly does this (as far as I remember):

  • Split given text in lines (\n).
  • Then, everything is handled as a word that is surrounded by spaces.
  • In each line, the next word is inserted as long as it does not lap outside the right border. If it does, start a new line.
  • If we are at the left text box border and the word is longer than the available width, forcedly break the word into pieces that do fit.

Please note that only standard spaces 0x20 are handled this way.
Also, if your text does not contain a comma follwed by a standard space like this ", " but instead some Chinese character looking similar, then no line br…

Replies: 4 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@ILearn-better
Comment options

@ihnfsax
Comment options

@JorjMcKie
Comment options

Answer selected by JorjMcKie
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@ILearn-better
Comment options

@JorjMcKie
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #2620 on August 25, 2023 08:56.