Skip to content

insert_text insert_textbox and annotation's insert_free_text both hit a space, and the next word goes out of the area and breaks the line, but Chinese has no spaces, which leads to a single space, and then a sentence following it is treated as a word. #3372

Answered by JorjMcKie
izerui asked this question in Q&A
Discussion options

You must be logged in to vote

Well, why do you say the separation should happen as you indicate? There either is a space in the text or not.
If there is, then it will be used for line breaks when necessary.
Otherwise, the text is treated like a word with a length exceeding the rectangle width and it will be split as required at an arbitrary point.
There is no way to avoid this.

You must become active here:

  1. If the comfort coming with insert_textbox is not usable for, then use insert_text instead, based on your knowing better when to start a new line. Use Font.tength_length to find the length of a given string. As Chinese text is monospaced, you should easily be able to compute the right spots where to start a new line.

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@izerui
Comment options

Comment options

You must be logged in to vote
1 reply
@izerui
Comment options

Answer selected by izerui
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
not a bug not a bug / user error / unable to reproduce
2 participants
Converted from issue

This discussion was converted from issue #3370 on April 11, 2024 16:16.