26 January, 2009

Nice-looking Japanese Fonts in Fedora

Tested this on Fedora 9 and 10. Use at your own risk!

First, you need to open the terminal and switch to root

$ su
Once root enter the following to install Japanese support:

# yum groupinstall japanese-support

Once the installation finishes create 2 new directories where
you will put the MS Japanese fonts gothic and mincho

# mkdir /usr/share/fonts/truetype
# mkdir /usr/share/fonts/truetype/msjapanesefonts

Download fonts MS Gothic and MS Mincho from
http://www.linux.ryukent.co.uk/show.php?id=24

Direct links to the files are:
http://www.linux.ryukent.co.uk/download/msgothic.zip
http://www.linux.ryukent.co.uk/download/msmincho.zip

Once the zip files are downloaded unzip them to /usr/share/fonts/truetype/msjapanesefonts

# unzip msgothic.zip /usr/share/fonts/truetype/msjapanesefonts
# unzip msmincho.zip /usr/share/fonts/truetype/msjapanesefonts

Then rebuilt the font cache by issuing the following command:

# fc-cache -fv

Finally create a new file .fonts.conf file

# gedit ~/.fonts.conf

and copy paste the following into it:

<?xml version="1.0"?>
<fontconfig>
<alias>
<family>serif</family>
<prefer>
<family>DejaVu Serif</family>
<family>Times New Roman</family>
<family>MS 明朝</family>
<family>IPAPMincho</family>
<family>Sazanami Mincho</family>
<family>Kochi Mincho</family>
<family>Bitstream Vera Serif</family>
<family>Thorndale AMT</family>
<family>Luxi Serif</family>
<family>Nimbus Roman No9 L</family>
<family>Times</family>
<family>Frank Ruehl</family>
<family>MgOpen Canonica</family>
<family>AR PL SungtiL GB</family>
<family>AR PL Mingti2L Big5</family>
<family>FreeSerif</family>
<family>Baekmuk Batang</family>
</prefer>
</alias>
<alias>
<family>sans-serif</family>
<prefer>
<family>DejaVu Sans</family>
<family>Verdana</family>
<family>MS ゴシック</family>
<family>IPAPGothic</family>
<family>Sazanami Gothic</family>
<family>Kochi Gothic</family>
<family>Bitstream Vera Sans</family>
<family>Arial</family>
<family>Albany AMT</family>
<family>Luxi Sans</family>
<family>Nimbus Sans L</family>
<family>Helvetica</family>
<family>Nachlieli</family>
<family>MgOpen Moderna</family>
<family>AR PL KaitiM GB</family>
<family>AR PL KaitiM Big5</family>
<family>FreeSans</family>
<family>Baekmuk Dotum</family>
<family>SimSun</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>DejaVu Sans Mono</family>
<family>Courier New</family>
<family>MS ゴシック</family>
<family>IPAGothic</family>
<family>Sazanami Gothic</family>
<family>Kochi Gothic</family>
<family>Bitstream Vera Sans Mono</family>
<family>Andale Mono</family>
<family>Cumberland AMT</family>
<family>Luxi Mono</family>
<family>Nimbus Mono L</family>
<family>Courier</family>
<family>Miriam Mono</family>
<family>FreeMono</family>
<family>AR PL KaitiM GB</family>
<family>Baekmuk Dotum</family>
</prefer>
</alias>
<match target="font">
<edit mode="assign" name="embeddedbitmap">
<bool>true</bool>
</edit>
</match>
/fontconfig>
</fontconfig>

Finally save the file and reboot. You should now have good looking Japanese
displayed when you browse web-sites with Japanese content.

Note: Info about fontconfig can be found at
http://www.fontconfig.org/fontconfig-user.html
Alternatively, you can download the .fonts.config file from
http://www.linux.ryukent.co.uk/download/fonts.conf.html