When running the JAVAGUI application in Ubuntu, we found that all Chinese characters in the application are displayed as boxes, and the Chinese characters in some applications in my system are displayed as boxes. Try to remove/etc/fonts/conf. d/49-sansserif.conf is ineffective. Now, Linuxidc has collected and sorted out some solutions: 1. The reason for the box text is that the corresponding font cannot be found in the java Runtime Environment, the method for copying the system font to the java Runtime Environment is as follows:
When running the java gui application in Ubuntu, I found that all Chinese characters in the application are displayed as boxes, and the Chinese characters in some applications in my system are displayed as boxes.
Try to remove/etc/fonts/conf. d/49-sansserif.conf but it does not work.
At present, Linuxidc has collected some solutions:
I,
The reason for the box text is that the corresponding font cannot be found in the java Runtime Environment, so the method to copy the system font to the java Runtime Environment is as follows:
Cd/usr/local/jdk1.5.0 _ 16/jre/lib/fonts/fallback // first enter the font location under your jdk installation path
Sudo cp/usr/share/fonts/truetype/arphic/uming. ttc. // copy the fonts in the system to this directory.
Sudo mkfontdir // set the font to take effect.
Sudo mkfontscale
Now let's take a look. Everything is normal. Haha!
II. The above method may also be used. I have never tried it, but we need to clarify that the cause of this problem is a small BUG in the java configuration file, he mistakenly converted the font suffix "ttc" to "ttf.
The simplest solution is:
Edit configuration file
Sudo gedit/usr/lib/jvm/java-6-sun/jre/lib/fontconfig. properties
Find
Filename.-arphic-ar_pl_shanheisun_uni-medium-r-normal -- *-p-*-iso10646-1 =/usr/share/fonts/truetype/arphic/uming. ttf
Filename.-arphic-ar_pl_uming_uni-medium-r-normal -- *-p-*-iso10646-1 =/usr/share/fonts/truetype/arphic/uming. ttf
You can change the suffix to ttc, because the file in usr/share/fonts is uming. ttc rather than the end of ttf.