This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 269487

Summary: IDE not able to display Chinese correctly in code
Product: editor Reporter: par7133
Component: Painting & PrintingAssignee: Miloslav Metelka <mmetelka>
Status: NEW ---    
Severity: normal CC: masaki, renzhi
Priority: P2    
Version: 8.2   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:
Attachments: IDE log
<no description>
Source Han Sans CN
on ubuntu

Description par7133 2017-01-05 00:57:00 UTC
Product Version = NetBeans IDE 8.2 (Build 201609300101)
Operating System = Linux version 4.8.15-300.fc25.x86_64 running on amd64
Java; VM; Vendor = 1.8.0_101
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.101-b13

Reproducibility: Happens every time

  * Open the Resources.sql attached
  * the Chinese show up but not completely correctly

  the Chinese must show up correctly
Comment 1 par7133 2017-01-05 00:57:05 UTC
Created attachment 163339 [details]
IDE log
Comment 2 par7133 2017-01-05 00:58:02 UTC
Created attachment 163340 [details]
<no description>
Comment 3 Masaki Katakai 2017-01-05 01:07:32 UTC
Thank you for using NetBeans and filing issue.

Could you please attach the screenshot?
Comment 4 par7133 2017-01-05 02:48:31 UTC
Created attachment 163341 [details]
Comment 5 par7133 2017-01-05 02:49:07 UTC
Created attachment 163342 [details]
Comment 6 Masaki Katakai 2017-01-05 04:44:35 UTC
(In reply to par7133 from comment #5)
> Created attachment 163342 [details]
> Screenshot2

Thank you for screenshot.

Displaying rectangle means necessary glyphs are not in the specified fonts. Could you try to change to another font setting in options > fonts and colors on netbeans? I understand netbeans is using one single font to display glyphs so chinese fonts need to be specified.

According to IDE log, you started netbeans in en_US. I'm not sure if necessary chinese fonts are in font path or not in en_US. I understand it's generic issue of java and I hope you can find common solution on linux.
Comment 7 par7133 2017-01-05 10:06:49 UTC
I tried all the monospaced fonts recognized by NetBeans (or by Java, not sure) but no one comes with full unicode support.

Can you help me in the steps to find some new fonts for my system (Fedora 25)? Are there some download links?

Comment 8 par7133 2017-01-05 15:05:46 UTC
I further investigate about, for example, the Source Sans Han CN Regular font that should give me support for the Chinese language. Under my system font viewer the latin characters are all displayed correctly but NetBeans fails to display at all.

You also stating about the fonts path and the language en_US of the IDE but I'm not clear how to deal with both of them as both fonts path and language aren't configurable by the interface.
Comment 9 par7133 2017-01-05 15:06:47 UTC
Created attachment 163346 [details]
Source Han Sans CN
Comment 10 Masaki Katakai 2017-01-06 09:32:13 UTC
Created attachment 163347 [details]
on ubuntu

Here is the screenshot on my ubuntu and monospaced fonts. It works.
Comment 11 Masaki Katakai 2017-01-06 09:36:51 UTC
I attached screenshot on my ubuntu. Just setting to monospaced works fine to display these characters.

I'm sorry I'm not using Fedra. Usually it can just works by changing to monospaced. I understand JDK provides the default configuration for the best monospaced fonts in the distribution. Unfortunately it's not working on Fedra.

I'll continue to find the solution but could you search any similar issue and solution for Fedra? It's not NetBeans issue, I understand it's common issue of Java.
Comment 12 par7133 2017-01-06 17:52:09 UTC
Yes, I confirm you that Monospaced font in the font settings doesn't work on Fedora.
Comment 13 Martin Balin 2017-03-27 15:25:57 UTC
No other report from other OS, users,... lowering to P2.
Comment 14 renzhi 2017-10-31 10:02:37 UTC
I have been struggling to get NetBeans to display Chinese characters for a long time, none of the fonts on my system (Debian testing/buster) can display Chinese characters, including the Chinese fonts. But these fonts work correctly on other applications, including Emacs, all the terminals I use (xfce4-terminal, gnome-terminal, etc), all the browsers (Firefox, Chromium), Eclipse, Intellij, ....

I'm running NetBeans 8.2 with JDK 1.8.0_131.

It would be really nice if NB could use some smart.