canonical / Ubuntu-Sans-fonts

Other
54 stars 4 forks source link

Problem with handling Chinese punctuation, such as enumeration comma(、) and full stop(。). #117

Open gapplef opened 2 months ago

gapplef commented 2 months ago

Some Chinese characters, such as enumeration comma(、) and full stop(。), displayed incorrectly in text-editor including gnome-text-editor, zim-wiki, and sublime-text etc. on Ubuntu 24.04, while in firefox everything displayed without problem.

Most special case is vscode, it have the same problem when use Chinese punctuation with English words, while used with Chinese words it could auto correct the display problem. The following picture shown the display of 测试、test、1、2、3、4、5、6。 and test、测试、1、2、3、4、5、6。 in gnome-text-editor(left) and vscode(right).

bug

The problem can be solved by setting custom font to Monospace or Noto Sans CJK in perferences of gnome-text-editor, while with Ubuntu, Ubuntu Mono or Ubuntu Sans, the problem exist. So this should be a problem related to the default font for Chinese characters in Ubuntu 24.04.

rschiang commented 2 months ago

Tested Ubuntu Sans 1.006 on macOS; seems fine. I would suggest looking into your font fallback stack or gnome’s rendering engine instead.

gapplef commented 2 months ago

@rschiang Thanks for your help!

Sorry, I am just a regular user meet this problem after install Ubuntu 24.04 recently. What do you mean by font fallback stack or gnome’s rendering engine?

Are you suggesting there is something wrong with the font setting of Ubuntu 24.04 or GTK3&GTK4 font rendering? It happened after a fresh installation, and I don't think I have touched any of those things, so it should be a bug somewhere. How could I check those and where should I report the bug?


Also, I think the full stop(。) position is not correct in your screenshot. It should located at the bottom of the line, not the center, as you can see from the bottom right of my previous picture.

rschiang commented 2 months ago

Hi @gapplef, what I meant is that the problem doesn’t seem to be related to the Ubuntu font itself. Reading from your screenshot, it seems that either there are some problems regarding how your OS render these fonts, or there might be some bugs related to Gnome text editor.

As you can see, the font correctly renders on other operating systems (in my case, MacOS). Hence, for others to assist you with the issue, we’ll probably need more information regarding how you set up the system or how we could reproduce the issue using a fresh Ubuntu copy.


Regarding to the question on full stop (。) position, no—the screenshot was perfectly fine. Folks in different parts of Asia uses different punctuation rules, as you could read from Wikipedia:

When used with traditional characters, the full stop is generally centered on the mean line; when used with simplified characters, it is usually aligned to the baseline.

Hope this helps!

gapplef commented 2 months ago

As same problem also found in zim-wiki, sublime-text and vscode, so it not a bug related to Gnome text editor. And the problem seems also not relate to gtk or gnome. https://gitlab.gnome.org/GNOME/gnome-text-editor/-/issues/675

It should be something relate to default font setting of my Ubuntu 24.04, I may need to check with a fresh installation when having time. The only special thing might relate to font problem is that I install ibus-rime and used rime-ice config. Also I migrate some config dotfiles direct from Ubuntu 22.04, not sure is that relevant.

gapplef commented 2 weeks ago

@rschiang I can reproduce this bug with a fresh installation. The problem only appear when the system language is set to English. All thing is fine if set the language to Chinese.

rschiang commented 2 weeks ago

@gapplef I installed the 1.006 variable font on GNOME Editor on Fedora 40 and still cannot reproduce the issue. I haven’t had time to verify this on a fresh Ubuntu installation though. (Might do that during weekends)

Could this be an issue related to zh-CN fallback font? Could you examine your version of Noto Sans SC / Source Han Sans and see if it’s too old?

Gnome Editor on Fedora 40
gapplef commented 1 week ago

I'm not sure how to check the version, but here is the result of apt search: Screenshot from 2024-07-02 20-55-24