[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Debian java japanese input method and display problem



Takashi Okamoto wrote:
> 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).
Thank you Okamoto-san for your tip.  I don't recall seeing sazanami but I will
install it using the debian "aptitude" .deb package installer.

I do have more information though.  It seems the most compatible font I have for
run 日本語 applications are:
GT2000-01
東風ゴシック
東風明朝

I noticed that the following fonts have some but not all characters that match
hiragana, katakana and kanji.
It's not a scientific test but I used the string in the text area.  Note the
last two characters have slash slash double-byte encodings so won't display
anything in this email.
"abcABC かきくーこ カキーコ 先生 元気 \\u5916\\u520A "
The one character that was missing among many of
the fonts listed below was "ー".  Hence they didn't make it to the short list
above.  All of these are beautiful fonts and are worth mentioning if you would
consider mixing fonts in order to get all the valid characters dislayed in your
documents.

AR PL KaitiM GB
AR PL SungtiL GB
Baekmuk Batang
Baekmuk Dotum
Baekmuk Gulim
Baekmuk Headline
FreeSans
FreeSerif
GT2000-01
GT2000-02
GT2000-03
GT2000-04
GT2000-05
GT2000-06
GT2000-07
GT2000-08
GT2000-09
GT2000-10
GT2000-K1
GT2000-K2
UnBatang
UnBom
UnDotum
UnGraphic
UnGungseo
UnJamoBatang
UnJamoDotum
UnJamoNovel
UnJamoSora
UnPen
UnPenheulim
UnPilgi
UnShinmun
UnTaza
UnYetgul

One more font that I found interesting but didn't seem to have kanji
was "Andale Mono".  It has a nice hiragana and katakana however.

WARNING:  Selecting the "aakar" font in Font2DTest made may Java Virtual Machine
crash on Debian.

QUESTION:  How does one programmatically check in a java application if a font
fulfills the required japanese character encodings?

OBSERVATIONS:
--------------------------
1)Make sure all the gui controls have their font set to a japanese font.
-the UserTextArea in order for keyboard input to display correctly.
-there are font names using nihongo in their name.  Set the fontMenu gui control
font to a japanese font in order to display these correctly.  From what I
noticed the default "Dialog" font does not display "東風ゴシック" and "東風明朝"
correctly in the font name list.
2)ANTIALIAS THE JAPANESE FONTS in order to see them at their best.


Here are the java code bits:
-----------------------------
//start with user text area for the range of characters to display
//in FontPanel's font canvas "fc"
textMenu.setSelectedItem("User Text");

//In the user text area, have it display
//-some ascii abcABC
//-hiragana かきく
//-katakana カキーコ
//-the ー character denoting elongation of pronunciation in katakana
//-some kanji 先生 元気
//-the java slash slash style unicode encoding \\u5916\\u520A
userTextArea = new JTextArea( "abcABC かきくーこ カキーコ 先生 元気
\\u5916\\u520A " );

//Now set the font to one of the following three for the font menu to display
japanese characters in the font menu correctly.
//fontMenu.setFont( new Font( "東風ゴシック", Font.PLAIN, 40 ));
//fontMenu.setFont( new Font( "東風明朝", Font.PLAIN, 40 ));
fontMenu.setFont( new Font( "GT2000-01", Font.PLAIN, 40 ));

//Now select a japanese font from the font menu in order for the
//font canvas to display fonts correctly.
fontMenu.setSelectedItem("GT2000-01");

//Now set the font for the user text area to a japanese font
//in order for the japanese keyboard input to display correctly
//when you type it in.
//userTextArea.setFont( new Font( "東風ゴシック", Font.PLAIN, 40 ));
//userTextArea.setFont( new Font( "東風明朝", Font.PLAIN, 40 ));
userTextArea.setFont( new Font( "GT2000-01", Font.PLAIN, 40 ));

//this helps the display output
boolean useAntialiasOpt = true;
boolean useFractionalOpt = true;

Cheers



Reply to: