jfreechart에서 한글 문제 해결.

Coumputer's/Java 2008. 7. 1. 09:54


JRE에 한글 font가 설치 되어있지 않아서 발생하는 문제

JAVA_HOME/jre/lib 폴더에 보면 fontconfig 파일들이 존재한다.
이중 fontconfig.RedHat.properties.src 파일을 fontconfig.properties파일로 복사
fontconfig.properties파일에 쓰기 권한을 주고 편집

#> cp fontconfig.RedHat.properties.src fontconfig.properties
#> chmod +w fontconfig.properties
#> vi fontconfig.properties
--------------- font.config.properties 내용 --------------------------
# 생략
.
.
.
# AWT X11 font paths
awtfontpath.chinese-tw-iso10646=/usr/share/fonts/zh_TW/TrueType
awtfontpath.chinese-cn-iso10646=/usr/share/fonts/zh_CN/TrueType
awtfontpath.japanese-iso10646=/usr/share/fonts/ja/TrueType
awtfontpath.korean-iso10646=/usr/share/fonts/ko/TrueType      <---- 이부분을 폰트 파일의 위치로 수정

 서버에서 /usr/local/java...(java폴더명은 서버마다 틀릴수 있다.)/jre/lib/ 폴더에 있는

 fontconfig.RedHat.properties.src 열고  가장 밑에 부분에 있는 곳을 확인해본다.
........

# AWT X11 font paths
awtfontpath.chinese-tw-iso10646=/usr/share/fonts/zh_TW/TrueType
awtfontpath.chinese-cn-iso10646=/usr/share/fonts/zh_CN/TrueType
awtfontpath.japanese-iso10646=/usr/share/fonts/ja/TrueType
awtfontpath.korean-iso10646=/usr/share/fonts/ko/TrueType

/usr/share/fonts/ko/TrueType 디렉토리를 생성하고 그 디렉토리에
batang.ttc과 gulim.ttc파일을 복사해 넣는다.

tomcat을 재구동 시켜준다.