Some Asiatic characters are not displayed

Article ID: 2436
Last updated: 29 May, 2018
Article ID: 2436
Last updated: 29 May, 2018
Revision: 3
Views: 549
Posted: 16 Jan, 2014
by Dean J.
Updated: 29 May, 2018
by Gargani A.

Question

Why some Asiatic characters are not displayed in my application?

Cause

When you specify a font in Java (via font family name, style, and size), this specifies a "logical font". The logical fonts are mapped to sets of physical fonts through a file jre/lib/fontconfig.bfc, which is a binary file generated from jre/lib/fontconfig.properties.src. The physical fonts then have to be present on the system in locations that the JRE will find.

Answer

Three options you can take in order to display Korean, Japanese or Chinese characters and avoid the "hollow boxes":

1) Use portable font family names instead of too specific ones. For example, "Serif", "Sansserif", "Dialog" are portable font family names, whereas "Times", "Arial", "Dejavu" are not.
You need to check out for the font being set not only in your Java code, but should also check for hard-coded font in your css files.

2) Use a JRE that has a fontconfig file that supports your platforms. The Sun JRE has some deficiencies in this area, Sun bugs 6806878 (regarding openSUSE) and 65515846857465 (regarding Ubuntu).

3a) Use a JRE that has more fonts bundled in jre/lib/fonts/, or

3b) Install fonts on your own in the public locations. Use the "xset fp" command to update the font location list in the X server, and the "xlsfonts" command to view the list of fonts that match a certain specification.

For the points 2) and 3a), note that for several Linux brands, IBM JREs come with a better fontconfig and a better Unicode coverage than the Sun/Oracle JREs.

This article was:   Helpful | Not helpful
Report an issue
Article ID: 2436
Last updated: 29 May, 2018
Revision: 3
Views: 549
Posted: 16 Jan, 2014 by Dean J.
Updated: 29 May, 2018 by Gargani A.
Also listed in


Others in this category