Cannot display Chinese, Japanese, Korean characters if choosing font other than five LogicalFontName

Bug #1274495 reported by Tao Wang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openjdk-7 (Ubuntu)
New
Undecided
Unassigned

Bug Description

System Version:

  Description: Ubuntu 13.10
  Release: 13.10

Java Version:

  java version "1.7.0_51"
  OpenJDK Runtime Environment (IcedTea 2.4.4) (7u51-2.4.4-0ubuntu0.13.10.1)
  OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)

openjdk-7-jdk:
  Installed: 7u51-2.4.4-0ubuntu0.13.10.1
  Candidate: 7u51-2.4.4-0ubuntu0.13.10.1
  Version table:
 *** 7u51-2.4.4-0ubuntu0.13.10.1 0
        500 http://au.archive.ubuntu.com/ubuntu/ saucy-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ saucy-security/main amd64 Packages
        100 /var/lib/dpkg/status
     7u25-2.3.12-4ubuntu3 0
        500 http://au.archive.ubuntu.com/ubuntu/ saucy/main amd64 Packages

Just using Intellij IDEA as an example, Just use following step to reproduce the problem.

1) I did a fresh installation of Ubuntu 13.10 64-bit Desktop, choose Simplified Chinese (简体中文) as system language;
2) install openjdk 7 by : sudo apt-get install openjdk-7-jdk
3) Download IntelliJ IDEA from http://www.jetbrains.com/idea/
4) Create a new project, and create a new file with name either be Chinese, Japanese or Korean, as example, you can copy & paste the following strings to test it:

中文文件名
日本語のファイル名
한국어 파일 이름

5) During the input, you will notice the CJK characters a become a slim box, no character showed
6) After the file creation, the project explorer will display all the CJK characters as slim boxes. The screenshot is on the link

http://tinypic.com/r/2mg1q1x/8

7) You can go Settings -> Appearances -> to Override the default font by any one of {serif, sansserif, monospaced, dialog, dialoginput}, such as:

http://tinypic.com/r/4kfx1g/8

8) After that, the CJK characters can be shown correctly,

http://tinypic.com/r/m7uwyw/8

According to documentation, http://docs.oracle.com/javase/7/docs/technotes/guides/intl/fontconfig.html , the search sequence for fonts should follow the font configuration files like fontconfig.properties, which might be wrong at some point.

The expected behavior should be that whatever the font I choose, if it doesn't provide the glyph for the character, it will try to search the sequence, and find the first available font to render the character. Apparently, the search is broken at some point, so only 'slim box' showed for CJK characters.

This is a bug exists for several years, affected both openjdk-6 and 7, and at least since Ubuntu 10.10.

Revision history for this message
Tao Wang (dancefire) wrote :

Confirmed the same problem on NetBeans 7.4, this time, only editor font can be changed, so just create a new file, can copy the CJK characters to it, and change the font to something other than the five logical font, such as font 'Ubuntu'. The following screenshot shows the 'slim box' problem for CJK characters in NetBeans 7.4.

http://tinypic.com/r/izchv4/8

Revision history for this message
Tao Wang (dancefire) wrote :

To simplify the test, I created a demo which is modified from http://www.leepoint.net/notes-java/GUI-appearance/fonts/22fontdemo.html

https://gist.github.com/dancefire/8708590

also compiled as a jar and uploaded for testing.

This program will show a GUI to let user select different fonts. And in the sample text area, I put CJK characters inside, so it would be much easier for anyone to see the problem:

http://tinypic.com/r/105ppol/8

To run the demo:

java -jar fontdemo.jar

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.