After the font library is replaced by the body2 label, when extra-long Chinese content is input, the end of the line will lose 1 character when it is wrapped.
After the font library is replaced, the body2 tag will lose 1 character at the end of the line when it enters extra-long Chinese content.
After the font library is replaced, the body2 tag will lose 1 character at the end of the line when it enters extra-long Chinese content.
Can you provide a small program that demonstrates the issue? Thanks.
Cc @whereswaldon
I suspect (though I can't confirm without a reproducing program and font file) that this a consequence of only implementing UAX#14 line wrapping without UAX#29 line wrapping. The equivalent problem in latin languages is that we can't break lines in the middle of words right now.
Thank you for your reply @eliasnaur, but I'm sorry I couldn't reply to you in time. The problem I encountered is the same as that of @beikege. If there is any solution, please let me know, and I'll check it out in time.
Demo:https://go.dev/play/p/xZjCpQZenjG
analyse import "eliasnaur.com/font/noto/sans/jp/regular" [regular] font is for Japanese,not specially for Chinese; So, when run demo code, Chinese word "不伤",but display ☒.
in windows version 10 with language--simple Chinese, c:/windows/font/simfang.ttf[mean 简体仿宋] is true Chinese font.
I have solved the problem of Chinese garbled code, this is the solution, written using Chinese.
The problem here is not a garbled code problem, the demo just uses the Japanese font for convenience.
You can drag and zoom the window left and right, you will find that 1 character will be lost at the end of the line.
I think I understand the source of this problem. Our code for calculating the visible bounds of a line of text sometimes mis-fires and drops the final character. Because our line wrapper doesn't break within words, the final character is usually a whitespace character and thus the mistake is invisible. I don't have a fix yet, but I'm looking into it.
~whereswaldon Thank you