|
Java™ by example!
|
|
|
How do I use a Japanese font in my Swing components?
To answer this question, I installed a japanese font to play around with (I am Belgian and don't know Japanese). It's called MS Mincho and you can download it here. After installing it, we need to modify the JDK properties so that it recognizes this font. I assume here that you are using JDK1.2.2. Go to c:\jdk1.2.2\jre\lib\ and copy font.properties.ja to font.properties (smart to make a backup of the original font.properties first). Then modify this file font.properties and change serif.plain.0 to MS Mincho,ANSI_CHARSET. Also add the entry filename.MS_Mincho=msmincho.ttf. You can use this test program that allows you to display RTF text, using the RTFEditorKit. Point the URL in the application to http://www.esus.com/docs/Hello.rtf
Feel free to post any more sample code or detailed explanation on how to change the font.properties file to add MS Mincho properly.
Further Information
Author of answer: Joris Van den Bogaert
Comments
Comments to this answer are only viewable by members. Login or become a member!
|
|
|
|
|