Hi David, I have a same problem because I'm Japanese:) I resolved this problem by following steps. Would you try it?
(1)install ttf-sazamani-mincho and ttf-sazanami-gothic (maybe you can use kochi-subst but I used sazanami). (2)run xfontsel and ensure they are configured for X11. (3)copy fontconfig.Redhat.8.0.properties.src to fontconfig.properties in /usr/lib/j2sdk1.5-sun/jre/lib. (4)replace "-misc-kochi" to "-sazanami-". Then fontconfig.properties is describe as follows: ... serif.plain.japanese-x0201=-sazanami-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0\201.1976-0 serif.plain.japanese-x0208=-sazanami-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0\208.1983-0 ... After above configuration, you can see Japanese characters with Java2D application. You can learn font configuration more detail by following URL: http://java.sun.com/j2se/1.5.0/docs/guide/intl/fontconfig.html regards, Takashi Okamoto From: David Marceau <[EMAIL PROTECTED]> Subject: Re: Debian java japanese input method and display problem Date: Sat, 18 Dec 2004 01:49:34 -0500 > Ok, > > I discovered this note. > http://java.sun.com/j2se/1.5.0/relnotes.html#linux > mentions the following: > " > Because several Red Hat Linux versions do not have a TrueType font for JIS X > 0201 by default, the font configuration files for these versions do not > include > any definition for JIS X 0201. The workaround is to install a TrueType JIS X > 0201 font into the J2RE's lib/fonts/fallback directory > " > > What's bizarre is that Debian unstable version > /usr/lib/j2sdk1.5-sun/jre/lib/font.properties > had the correct entries for a font called: > kochi-mincho-subst.ttf > But the font wasn't in the jre/lib/fonts directory. > > My quick solution: > 1)"cp /var/lib/defoma/gs.d/dirs/fonts/kochi-mincho-subst.ttf > /usr/lib/j2sdk1.5-sun/jre/lib/fonts" > 2)I changed the in the demos/jfc/Font2DTest/src/Font2DTest.java, > I changed the font from "Dialog" to something that works for input method and > encoding in question: > userTextArea.setFont( new Font( "AR PL KaitiM GB", Font.PLAIN, 40 )); > > 3)in the Font2DTest, I changed the default selected font to something that > works > for the encoding and input method in question: > fontMenu.setSelectedItem( "AR PL KaitiM GB" ); > fontMenu.setSelectedItem( "UnGungseo" ); > > Now the strange grey square blocks don't appear when I input > katakana/hiragana/kanji using the "kinput2 > -canna" input method. > > NOTE: I still get the strange grey square blocks but only when the wrong font > is > used for the input userTextArea. i.e. the default java -jar Font2DTest.jar > still gives strange grey square blocks after placeing the ttf file in the > jre/lib/fonts directory because it still uses the default "Dialog" font for > the > input userTextArea which doesn't seem to have nihongo characters. > > Could someone please advise me why the default Dialog font doesn't support > nihongo straight out of the box? Is this the correct behaviour? > > David Marceau wrote: > > Hi there everyone, > > > > My name is David Marceau. I am researching how to develop a java gui that > > is > > multilingual and that accepts japanese character input. How do I make > > Debian > > java jdk1.5 accept japanese character input and properly display these in a > > java > > gui components(i.e. textarea/combobox...)? > > > > ----------------------------------------------------------------- > > CURRENT CONFIGURATION > > ----------------------------------------------------------------- > > I am using: > > -Debian unstable version > > -Debian is configured japanese EUC-JP. > > -Debian keyboard input for japanese works via "kinput2 -canna" with mozilla > > and > > openoffice with no problems. > > > > Here is how I installed jdk1.5 with debian unstable: > > # in order to have make-jpkg, you need to install the virtual package > > # "java-package". You need to download the jdk15.bin file from sun. > > # Then you create a .deb/knoppix package with this. > > fakeroot make-jpkg jdk-1_5_0-linux-i586.bin > > dpkg -i sun-j2sdk1.5_1.5.0+final_i386.deb > > apt-get install sun-j2sdk1.5debian > > > > #once it is installed > > #the command lines aren't pointing to the new 1.5 tools > > # you need to do the following > > update-alternatives --config java > > update-alternatives --config javac > > update-alternatives --config serialver > > # there are many other jdk command-line tools that need to have > > # their alternatives changed to point to the 1.5 bin path > > # update-alternatives --config serialver > > # > > # There are 3 alternatives which provide `serialver'. > > # > > # Selection Alternative > > # ----------------------------------------------- > > # + 1 /usr/lib/j2se/1.4/bin/serialver > > # 2 /usr/bin/serialver-cp > > # * 3 /usr/lib/j2sdk1.5-sun/bin/serialver > > # > > # Press enter to keep the default[*], or type selection number: 3 > > # Using `/usr/lib/j2sdk1.5-sun/bin/serialver' to provide `serialver' > > # > > # Do this update-alternatives dance to all the jdk tools you need to use. > > # If you don't you will come up with > > # some funky errors you won't know where they came from > > > > ----------------------------------------------------------------- > > TO DEMONSTRATE WHERE MY PROBLEM ARISES > > ----------------------------------------------------------------- > > cd jdk1.5.0/demo/jfc/Font2DTest > > java -jar Font2DTest.jar > > When I select "USER TEXT" in the range combo box, a popup textarea dialog is > > shown. When I do shift+space to enter japanese input method mode, the > > characters I type display square gray blocks as opposed to true japanese > > hiragana/katakana/kanji. > > THAT IS THE PROBLEM...it doesn't display what I type properly. > > > > NOTE: Below the improperly displayed text is an update button that takes > > what I > > typed in the user text box and draws this into the main dialog's font > > canvas. > > Surprisingly when I press the update button, the main dialog's font canvas > > displays the hiragana/katakana/kanji properly while the user text dialog's > > characters still display my input with square blocks??? > > > > I am aware of > > jfc/CodePointIM/CodePointIM.jar > > docs/guide/imf/spi-sample/CityIM.jar > > and I tried putting them in the jre/lib/ext directory but I didn't see any > > changes. It still displayed square blocks when I type in japanese input > > mode. > > That said I didn't see the expected input method menu in the window's > > command > > button displayed. > > > > Any help in this matter would be greatly appreciated. Thank you for > > considering > > my request.