KGS Issue - Asian Fonts

    Keywords: Software

This page addresses the problem that Asian fonts are not correctly displayed on several operating systems.

Table of contents

// Note: This page has been merged from two different pages. Please feel free to edit the text to combine the best of both.

Windows (and probably Linux)

CBlue: For those who use CGoban2 client to play on KGS and who only see some squares instead of asian fonts (Japanese, Chinese, Korean), here is a solution (Tested on Windows 2000 Pro SP4, probably works similar for Linux. I'm not sure about very old Windows versions like 95.)

NO WARRANTY IS GIVEN FOR ANY OF THESE SUGGESTIONS. IF SOMETHING DOESN'T WORK ON YOUR PC I DON'T TAKE RESPONSIBILITY.

-Go here, and download the Cyberbit.ZIP file (Cyber Bitstream Font which contains all Unicode characters to display all of those three languages) [ext] ftp://ftp.netscape.com/pub/communicator/extras/fonts/windows/ Move the font into your system's font folder. (for example C:\WinNT\Fonts)

-Search your Java installation for a file called 'font.properties', make a backup (just in case..) and replace it with this one: [ext] http://www.c-blue.de/tmp/font.properties.zip (You might not be able to replace the file while Java is running, in that case close CGoban2 first.) After restarting CGoban2, you should be able to read Japanese, Chinese and Korean characters!

Pampalini?: sorry, but i just installed java 5.0 and still only boxes .. other apps display japanese fonts correctly, only java has this problem
windows version : win98SE english
the strange thing is japanese (and all other) characters are displayed correctly in every other application (IE,Opera,Word etc.) except Java (both 1.4 and 1.5)
I've tried a lot of things, with no result. (like using font.properties.ja instead of font.properties, the above cyberbitstream fonts - i've installed both the font and the font.properties file - uninstalling and reinstalling the java runtimes, checking windows update if i am maybe missing some windows component ...)

-install the IME method
-the fonts ms gothic and msmincho both in the windows fonts files and in the directory of java where you find other fonts, in the directory lib i think but can't remember right now, be sure to rename them in .ttf (not ttc)
(you can find all this there : [ext] http://kanji.free.fr/download.php
-redo the swap of font.properties.ja into font.properties (don't forget to make a back up in a different directory)
- and relaunch KGS ^_^
before all this I suggest to reinstall java because you seem to have change a lot of settings

-Restart CGoban2 and you're settled.

(KGS help page about fonts is [ext] http://kgs.kiseido.com/en_US/fonts.html)

Maybe someone who has tried similar for different operating systems can contribute his/her results here.


MacOS X

These instructions are straight from KGS's font help page, with a small exception.

1. Right-click (or control-click) on the CGoban app icon and choose "Show Package Contents".

2. Open the "Contents" folder.

3. Double-click on the "Info.plist" file.

There are two possibilities here.

If the file opens in Property List Editor:

4a. Expand the "Root" list. (Click the triangle to the left of the word.)

5a. Find "CFBundleDevelopmentRegion". The string to the right should say "English". Double-click this and replace "English" with the name of the language you want to use. ("Japanese" works for Asian languages, to my knowledge.)

If MacOS asks which application you want to open the file with, and Property List Editor is not available, choose TextEdit, and:

4b. Find the string "CFBundleDevelopmentRegion" in the file.

5b. In the <string> element immediately following that line, replace "English" with the language you wish to use ("Japanese", for example).

6. Save and quit.

There is a side effect to this, however: the Apple menu and the stub CGoban menu in the menu bar appear in Japanese. To access the Apple menu, simply switch to a different app temporarily.


Malweth - This worked great for me on Windows 2000 with no Admin access (no Admin access means you can only install Java up to version 1.3.1 and cannot install the MS IMEs). Weiqi.tom.com is going to be a lot nicer looking now :)

Linux (Tested with Debian)

A practical guide(by helger) for debian users (other linux distros handle it similarly) how to see Korean/Japanese fonts in linux.

Java 1.4

  1. Install Korean fonts: apt-get install ttf-baekmuk, apt-get install xfonts-baekmuk
  2. Link or copy all fonts from /usr/share/fonts/truetype/baekmuk to $JAVA_HOME/lib/fonts (if $JAVA_HOME points a j2re installation) or to $JAVA_HOME/jre/lib/fonts(if it points to a j2sdk installation).
  3. cd to the destination directory (.../lib/fonts), do ttmkfdir > fonts.dir (for this you might have to do apt-get install ttmkfdir at first)
  4. cd .., add the next to the end of the font.properties:
  serif.2=-misc-Baekmuk Batang-medium-r-normal--0-0-0-0-c-0-ksc5601.1987-0
  serif.bold.2=-misc-Baekmuk Batang-medium-r-normal--0-0-0-0-c-0-ksc5601.1987-0
  sansserif.2=-misc-Baekmuk Gulim-medium-r-normal--0-0-0-0-c-0-ksc5601.1987-0
  sansserif.bold.2=-misc-Baekmuk Gulim-medium-r-normal--0-0-0-0-c-0-ksc5601.1987-0

Restart cgoban. It should work. (Let me know if it does not.) To see both Korean and Japanese, just add

  sansserif.3=-wadalab-gothic-medium-r-normal--0-0-0-0-p-0-jisx0208.1983-0

sansserif.bold.3=-wadalab-gothic-medium-r-normal--0-0-0-0-p-0-jisx0208.1983-0
serif.3=-watanabe-mincho-medium-r-normal--0-0-0-0-p-0-jisx0208.1983-0
serif.bold.3=-watanabe-mincho-medium-r-normal--0-0-0-0-p-0-jisx0208.1983-0

at the end of your font.properties. (For this, you obviously must have the watanabe fonts installed, use apt-cache search watanabe to find them.)

For adding more fonts (Chinese, ...) just follow the same pattern.

Java 1.5 (beta 2)

I have no idea why the next sequence works, but it does so on my box. (Documentation says that you also must do something else, but for me the next two steps were sufficient.)

  1. Get all the same Korean/Japanese fonts.
  2. Create directory $JAVA_HOME/jre/lib/fonts/fallback
  3. Copy the files into that directory, or link to the files from it.

helger

---

penguin: The [ext] Cyberbit font from netscape works for me in java 1.5.0 on linux --- no boxes in the entire room list on KGS. Just for clarity, I didn't have to create a fonts.dir file, nor a font.properties file, in the fallback directory, as one might normally expect from dealing with java 1.4. But see the following rewrite of Helger's instructions. (Delete this comment and the previous guide when the following guide has been vetted/confirmed.)

---

This is a rewrite of helger's instructions

Linux (should be universal; tested with Slackware 10.0)

First, get the [ext] Cyberbit font from netscape. Unzip it to obtain the Cyberbit.ttf file. (You might already have a copy in /usr/X11R6/lib/X11/fonts/TTF/, or some similar location.)

In the following, you might be able to use symlinks to your system's copy of Cyberbit.ttf rather than copying the file --- it is about 13M. (penguin: symlinks didn't work for me when using ttmkfdir, ymmv.)

Java 1.4 (tested with j2sdk-1_4_2_05-linux-i586)

  1. copy Cyberbit.ttf to $JAVA_HOME/lib/fonts (if $JAVA_HOME points a j2re installation), or to $JAVA_HOME/jre/lib/fonts (if it points to a j2sdk installation).
  2. cd to the .../lib/fonts directory you used in the previous step.
  3. do ttmkfdir -o junk (you can locate a copy of ttmkfdir [ext] here)
  4. copy the lines in junk which pertain to the Cyberbit font to the end of your fonts.dir file, and change the number at the top to reflect the number of data lines in the file --- this just happened to be 88 on my system. (That is, the file is 89 lines long; the first line is just '88', and is followed by 88 lines of font info. wc -l fonts.dir may help here.) You might be able to get away with ttmkfdir -o fonts.dir, but back up the original file first; this really messed up the fonts in cgoban2 when I tried it (think supertiny CGoban2 main window and invisible fonts). It appears that ttmkfdir is too ambitious when dealing with java's Lucida fonts.
  5. cd .. (change to the directory above the directory you changed to in step 2)
  6. add the next to the end of the font.properties file (note that the gobbledygook after the '=' is just the end of the line from the ttmkfdir output which pertains to Cyberbit's jisx font):
  serif.2=-Bitstream-Bitstream Cyberbit-medium-r-normal--0-0-0-0-c-0-jisx0201.1976-0
  serif.bold.2=-Bitstream-Bitstream Cyberbit-medium-r-normal--0-0-0-0-c-0-jisx0201.1976-0
  sansserif.2=-Bitstream-Bitstream Cyberbit-medium-r-normal--0-0-0-0-c-0-jisx0201.1976-0
  sansserif.bold.2=-Bitstream-Bitstream Cyberbit-medium-r-normal--0-0-0-0-c-0-jisx0201.1976-0

Restart CGoban2. It should work for all the asian fonts (and Hebrew! others?) on KGS. If it doesn't try again and make sure all instances of java are shut down before restarting CGoban2.

Note: Earlier instructions were ttmkfdir >junk. Changed to ttmkfdir -o junk per version shipping with RedHat. File is 101290 bytes dates Sep 15, 2003

TODO: contact helger for help? Helger?

Java 1.5 (tested with jdk-1_5_0-nb-4_0-beta2-bin-linux and jre-1_5_0-linux-i586)

penguin: I have no idea why the next sequence works, but it does so on my box. (Helger claimed the (unreferenced) documentation said that you also must do something else, but for me the following steps were sufficient.)

  1. Create directory $JAVA_HOME/lib/fonts/fallback (if $JAVA_HOME points a jre installation), or else create directory $JAVA_HOME/jre/lib/fonts/fallback (if $JAVA_HOME points to a jdk installation) [someone please confirm the changed/correct j2re/jre j2sdk/jdk terminology for 1.4/1.5]
  2. Copy Cyberbit.ttf to the .../lib/fonts/fallback directory you made in step 1.
  3. Thats' it!

Restart CGoban2. It should work for all the asian fonts (and Hebrew! others?) on KGS. If it doesn't try again and make sure all instances of java are shut down before restarting CGoban2.

macelee: The above procedure was tested with a freshly installed j2sdk1.5 and proved to be working well. I can see Chinese, Japanese and a few other languages that I don't recognize. Remember to update the PATH variable if you are upgrading your Java environment from a previous version. For Webstart users, your web browser should be reconfigured to associate the jnlp file to the new Webstart binary.


This is a copy of the living page "KGS Issue - Asian Fonts" at Sensei's Library.
(OC) 2004 the Authors, published under the OpenContent License V1.0.
[Welcome to Sensei's Library!]
StartingPoints
ReferenceSection
About