~eliasnaur/gio#400: 
body2 中文编码问题

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.

Status
RESOLVED FIXED
Submitter
~lizheng
Assigned to
No-one
Submitted
7 months ago
Updated
a month ago
Labels
No labels applied.

~lizheng 7 months ago

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.

~lizheng 7 months ago

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.

~eliasnaur 7 months ago

Can you provide a small program that demonstrates the issue? Thanks.

Cc @whereswaldon

~whereswaldon 7 months ago

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.

~beikege 7 months ago

~lizheng 6 months ago

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.

~esword closed duplicate ticket #431 5 months ago

~bob_fs 4 months ago

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 ☒.

~bob_fs 4 months ago

in windows version 10 with language--simple Chinese, c:/windows/font/simfang.ttf[mean 简体仿宋] is true Chinese font.

~esword 4 months ago

I have solved the problem of Chinese garbled code, this is the solution, written using Chinese.

solution

~beikege 4 months ago

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.

~whereswaldon 2 months ago

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 REPORTED FIXED a month ago

~beikege a month ago

~whereswaldon Thank you

Register here or Log in to comment, or comment via email.