Linux Korean Configuration (리눅스 한글 설정)

This is my configuration with Ubuntu BreezyBadger (and Dapper) + Gnome 2.12.
This should generally work even with Fedora Core 4. However, if anything is missing/not right or if you have a better suggestion, please write a comment. If this article was useful, please write a comment. It is good to hear that writing this was not a waste of time.

Install font files

Copy gulim.ttc file to ~/.fonts. The gulim.ttc can be found on your windows machine (C:\WINDOWS\FONTS)
My recommendation is that install “msttcorefonts”, too. This will provide with essential Windows TTF font.

If ~/.fonts doesn’t exists, mkdir ~/.fonts

Install/Configure packages (UBUNTU)

Install input methods

Below is somewhat old. Try installing SCIM

sudo apt-get install nabi im-switch imhangul language-pack-ko language-pack-gnome-ko

Install Korean support packages

sudo apt-get install language-pack-ko language-pack-gnome-ko

Reconfigure fontconfig

% sudo dpkg-reconfigure fontconfig

Choose “Enable bitmapped fonts by defaults” to “yes”, all others just keep the default value.

Reconfigure locales

% sudo dpkg-reconfigure locales

Check ko_KR.euckr, and ko_KR.UTF-8 from the option. (Dapper doesn’t ask for options here. If language-pack* is installed it will create above two locales automatically. Check that ko_KR.euckr and ko_KR.UTF-8 is generated during this step)

Add ~/.xinput.d/default

This launches nabi automatically when you login.

XIM=nabi
XIM_PROGRAM=/usr/bin/nabi
XMODIFIERS="@im=nabi"
GTK_IM_MODULE=hangul2

Using Nabi

If you followed above and if everything was correct, you can

Install/Configure packages (Fedora Core)

Install input methods

sudo yum install nabi imhangul

Add ~/.xinput.d/default

Follow above Ubuntu configuration

Modify ~/.fonts.conf (COMMON)

You can also modify /etc/fonts/fonts.conf. I like using ~/.fonts.conf since it won’t mess around with apt.
My setting is basically turning off anti-aliasing for Korean fonts (and for some English fonts that I like). Also, I like to change the font preference of Sans, Serif, and Monospace on fontconfig, and configure applications to use only above 3. Thereby, you will have fine quality on both English, and Korean.

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
 <dir>~/.fonts</dir>
 <match target="font" >
  <edit mode="assign" name="rgba" >
   <const>none</const>
  </edit>
 </match>
 <match target="font" >
  <edit mode="assign" name="hinting" >
   <bool>true</bool>
  </edit>
 </match>
 <match target="font" >
  <edit mode="assign" name="hintstyle" >
   <const>hintmedium</const>
  </edit>
 </match>
 <match target="font" >
  <edit mode="assign" name="antialias" >
    <bool>true</bool>
  </edit>
 </match>
 <match target="font" >
  <test compare="contains" name="family" qual="any" >
   <string>Gulim</string>
   <string>Dotum</string>
   <string>Batang</string>
   <string>Gungsuh</string>
   <string>Arial</string>
   <string>Courier New</string>
   <string>Times New Roman</string>
  </test>
  <test compare="more_eq" name="pixelsize" >
   <int>9</int>
  </test>
  <test compare="less_eq" name="pixelsize" >
   <int>16</int>
  </test>
  <edit mode="assign" name="antialias" >
   <bool>false</bool>
  </edit>
  <edit mode="assign" name="globaladvance" >
   <bool>false</bool>
  </edit>
  <edit mode="assign" name="dpi" >
   <double>96</double>
  </edit>
 </match>
 <alias>
   <family>serif</family>
   <prefer>
    <family>Times New Roman</family>
    <family>DejaVu Serif</family>
    <family>Gulim</family>
    <family>Bitstream Vera Serif</family>
   </prefer>
 </alias>
 <alias>
   <family>sans-serif</family>
   <prefer>
    <family>Arial</family>
    <family>DejaVu Sans</family>
    <family>Helvetica</family>
    <family>Dotum</family>
    <family>Bitstream Vera Sans</family>
   </prefer>
 </alias>
 <alias>
   <family>monospace</family>
   <prefer>
    <family>Courier New</family>
    <family>DejaVu Mono</family>
    <family>GulimChe</family>
    <family>Bitstream Vera Mono</family>
   </prefer>
 </alias>
 <alias>
  <family>굴림</family>
  <prefer>
   <family>Gulim</family>
  </prefer>
 </alias>
 <alias>
  <family>굴림체</family>
  <prefer>
   <family>GulimChe</family>
  </prefer>
 </alias>
 <alias>
  <family>돋움</family>
  <prefer>
   <family>Dotum</family>
  </prefer>
 </alias>
 <alias>
  <family>돋움체</family>
  <prefer>
   <family>DotumChe</family>
  </prefer>
 </alias>
 <alias>
  <family>바탕</family>
  <prefer>
   <family>Batang</family>
  </prefer>
 </alias>
 <alias>
  <family>바탕체</family>
  <prefer>
   <family>BatangChe</family>
  </prefer>
 </alias>
 <alias>
  <family>궁서</family>
  <prefer>
   <family>Gungsuh</family>
  </prefer>
 </alias>
 <alias>
  <family>궁서체</family>
  <prefer>
   <family>GungsuhChe</family>
  </prefer>
 </alias>
</fontconfig>

Application Setting

Desktop Fonts

Firefox

  • Just use Sans/Serif/Monospace, and it will show Gulim/Dotum properly.
  • Check “Allow pages to choose their own fonts, instead of my selections above”

Gnome-terminal

I use “Courier New” size 9.

If you are done, make sure run fc-cache -f and relogin. Not sure? just reboot your machine :)

Howto input Korean

If everything above went well, you should be able to toggle “Korean/English” with “Shift-Space” on all application. Occasionally, after restarting X or restarting VNC the nabi won’t work properly.

9 Responses to “Linux Korean Configuration (리눅스 한글 설정)”

  1. antispin Says:

    Extremely useful, thanks!

  2. mahli Says:

    I was searching for a way to configure my Ubuntu so I can write in Korean. This was the first one to come up.

    A suggestion: can you also put up some small note on how to use nabi?

    Just starting to learn Korean.
    Kamsahamnida.

  3. habals Says:

    Shift-space will toggle Korean/English keyboards

  4. mahli Says:

    Nope, it didn’t work that way. That’s the first thing I tried as it was suggested on the manual. I’ve also tried right clicking and left clicking on nabi status icon, and tried quite a few combinations including adding several more hot keys, and nothing worked… oh well… I think I’ll try SCIM next and see what will happen.

  5. habals Says:

    If you use VNC, conf should be a little bit different.
    How about adding
    LANG=ko_KR.eucKR in ~/xinput.d/default file

  6. secret26 Says:

    hey.
    i don’t understand! T_T
    copy what?copy where?

    kinda stupid but i really don’t understand a thing.
    HELP!

  7. Qday LEE Says:

    Hi Helper,

    I am now learning Linux system.

    How can I add below or where can I find ~/.xinput……?

    Thank you in advance.

    Add ~/.xinput.d/default

    This launches nabi automatically when you login.

    XIM=nabi
    XIM_PROGRAM=/usr/bin/nabi
    XMODIFIERS=”@im=nabi”
    GTK_IM_MODULE=hangul2

  8. Jungwoo Ha Says:

    Please try http://z.cs.utexas.edu/users/habals/blog/index.php/archives/59 this article. Anyway, both articles are out-dated. I haven’t used Korean on Linux for years.

  9. sandrar Says:

    Hi! I was surfing and found your blog post… nice! I love your blog. :) Cheers! Sandra. R.

Leave a Reply