Subject: Re: Japanese fonts in Java?
To: None <tech-pkg@NetBSD.org>
From: Shigeki UNO <shigeki@mediawars.ne.jp>
List: tech-pkg
Date: 01/05/2005 13:53:02
Thomas Klausner <wiz@NetBSD.org> writes:

| Hi!
| 
| Did anyone succeed in getting Java on NetBSD display Japanese
| fonts? If so, how?
| 
| Cheers,
|  Thomas

Nobody seems to respond to it, unfortunately. Here is an solution. 

(Assuming that you have already installed kochi font(pkgsrc/fonts/kochi-ttf) using pkgsrc.)  

1. In case of sun-jre14 (pkgsrc/lang/sun-jre14):

  % cd /usr/pkg/java/sun-1.4/lib
  % sudo mv font.properties.ja font.properties.ja.orig
  % sudo cp font.properties.ja.Redhat8.0 font.properties.ja
  % sudo vi font.properties.ja

diff -c font.properties.ja.Redhat8.0 font.properties.ja*** font.properties.ja.Redhat8.0      Wed Jan  5 12:53:53 2005
--- font.properties.ja  Wed Jan  5 13:12:32 2005
***************
*** 220,229 ****
  -misc-kochi mincho-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\
  -misc-kochi mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
  
! filename.-misc-kochi_mincho-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0=/usr/share/fonts/ja/TrueType/kochi-mincho.ttf
! filename.-misc-kochi_mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0=/usr/share/fonts/ja/TrueType/kochi-mincho.ttf
! filename.-misc-kochi_gothic-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0=/usr/share/fonts/ja/TrueType/kochi-gothic.ttf
! filename.-misc-kochi_gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0=/usr/share/fonts/ja/TrueType/kochi-gothic.ttf
  
  # Exclusion Ranges
  #
--- 220,229 ----
  -misc-kochi mincho-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0,\
  -misc-kochi mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
  
! filename.-misc-kochi_mincho-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0=/usr/pkg/lib/X11/fonts/TTF/kochi-mincho.ttf
! filename.-misc-kochi_mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0=/usr/pkg/lib/X11/fonts/TTF/kochi-mincho.ttf
! filename.-misc-kochi_gothic-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0=/usr/pkg/lib/X11/fonts/TTF/kochi-gothic.ttf
! filename.-misc-kochi_gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0=/usr/pkg/lib/X11/fonts/TTF/kochi-gothic.ttf
  
  # Exclusion Ranges
  #


2. In case of sun-jre15 (pkgsrc/lang/sun-jre15)

   This is much easer than sun-jre14. Just do like this.

   % sudo mkdir /usr/pkg/java/sun-1.5/lib/fonts/fallback
   % sudo ln -s /usr/pkg/lib/X11/fonts/TTF/* /usr/pkg/java/sun-1.5/lib/fonts/fallback/.


That's all. 

HTH,

---
Shigeki UNO