Page 1 of 4 123 ... LastLast
Results 1 to 10 of 33

Thread: HOWTO: Installing Japanese that looks nice on Ubuntu Edgy : 日本語

  1. #1
    Join Date
    Dec 2006
    Location
    All over the world!
    Beans
    Hidden!
    Distro
    Ubuntu 10.10 Maverick Meerkat

    HOWTO: Installing Japanese that looks nice on Ubuntu Edgy : 日本語

    HOWTO: Installing Japanese that looks nice on Ubuntu Edgy : 日本語

    OK, so it drove me absolutely crazy and I very nearly switched back to Fedora which would have been a great shame. All I wanted to do was install Japanese input that looked OK in an English install of Ubuntu. There were many different guides out there and most of which were incomplete or based on previous versions. So I have put what worked for me together in this thread. It might not work for you and I don't claim to have come up with it myself, but maybe some people might find it helpful. I hope the next version of Ubuntu has this out of the box (as Fedora does).

    There are two issues here:
    1.Installing the SCIM input system that will work in a locale other than converting your whole install to Japanese, i.e. you want Japanese input in an English login.
    2.The fonts look initially terrible. Therefore a certain amount of customisation is required to make all the Kanji's render in the same style and Hiragana & Katakana to render in a non-handwriting style.


    1.
    First lets make sure you have the correct repositories installed in order to automatically download the relevant packs. Open the repositories list file:

    Code:
    sudo gedit /etc/apt/sources.list
    Add the following line at the bottom:

    Code:
    deb http://archive.ubuntulinux.jp/ubuntu-ja edgy/
    Now update your repos with:

    Code:
    sudo apt-get update
    Go to System / Administration / Language Support and select Japanese. This should install the basics.

    You might want to install some other Asian input methods too. To make sure you have all the common ones, use:

    Code:
    sudo apt-get install uim anthy scim-gtk2-immodule scim-uim scim-chinese scim-hangul scim-tables-zh scim-tables-ja scim-tables-ko
    That should install Japanese, Chinese and Korean input. If you don't want them all, don't worry you can always hide them from the list later (in SCIM config), but it's probably a good idea to have them on your system.

    Now you want to make SCIM (Language input system) available in your English login and not just the Japanese one. First open the scim_startup file:

    Code:
    sudo gedit /etc/X11/Xsession.d/74custom-scim_startup
    Add these lines:

    Code:
    export XMODIFIERS="@im=SCIM"
    export GTK_IM_MODULE="scim"
    export XIM_PROGRAM="scim -d"
    export QT_IM_MODULE="scim"
    2.
    OK, now you've got Japanese input installed (hopefully). It will probably require rebooting xwindows (CTRL+ALT+Backspace). But for me, I really couldn't cope with the horrible fonts that defaulted especially as they were nice and pretty in Fedora. Here's the next step.

    Now that you have the Japanese repositories set up (see above), you'll want to get a nice set of fonts.

    Code:
    sudo apt-get install msttcorefonts ttf-dejavu ipafont ipamonafont ttf-arphic-ukai ttf-arphic-uming
    This will install the Microsoft (Freeware) core fonts and a number of other useful fonts, specifically ones that support Japanese unicode characters.

    Unfortunately, I am very disappointed in the Ubuntu distribution of DejaVu. It seems to be the default font, but you will almost certainly want this to be changed to MSGothic and MSMincho. These are Microsoft fonts, but they are freeware and are actually from a company called Ricoh so you can sleep at night knowing you're not using Microsoft if you want. They need to be downloaded and installed manually. They can be found at the following 2 sites.

    http://www.themeworld.com/cgi-bin/pr...msgothic.0.zip
    http://www.themeworld.com/cgi-bin/pr...msmincho.0.zip

    or

    http://www.wafu.ne.jp/3dlogo/fonts/msgothic.ttf
    http://www.wafu.ne.jp/3dlogo/fonts/msmincho.ttf

    So download the file and you need to copy them into the fonts directory. This will need root privileges and is probably easiest done using the file explorer:

    Code:
    sudo nautilus --browser
    That will give you a browser with the right privileges. So copy your downloaded ttf files and paste them into a folder under the fonts tree. I recommend:

    Code:
    /usr/share/fonts/truetype/msttcorefonts
    Now we need to rebuild the fonts cache:

    Code:
    sudo fc-cache -f -v
    OK, so that might well be enough, but I think you'll probably still have your Japanese fonts not running at optimum and the default might be a little ugly. Lets set up the order in which we like the fonts to be selected. Open the “.fonts.conf” file in your home directory:
    Code:
     sudo gedit .fonts.conf
    It should read as follows:

    Code:
    <?xml version="1.0"?>
    <fontconfig>
     <alias>
      <family>serif</family>
      <prefer>
       <family>Times New Roman</family>
       <family>MS 明朝</family>
       <family>IPAPMincho</family>
       <family>Sazanami Mincho</family>
       <family>Kochi Mincho</family>
       <family>DejaVu Serif</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>Verdana</family>
       <family>MS ゴシック</family>
       <family>IPAPGothic</family>
       <family>Sazanami Gothic</family>
       <family>Kochi Gothic</family>
       <family>DejaVu Sans</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>Courier New</family>
       <family>MS ゴシック</family>
       <family>IPAGothic</family>
       <family>Sazanami Gothic</family>
       <family>Kochi Gothic</family>
       <family>DejaVu Sans Mono</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>false</bool>
      </edit>
     </match>
     <match target="font" >
      <edit mode="assign" name="autohint" >
       <bool>true</bool>
      </edit>
     </match>
    </fontconfig>
    So, save the file and reboot xwindows (CTLR+ALT+Backspace). Now with any luck the order of fonts should have been updated so that the default Japanese type face is actually a clean one first and foremost instead of the ugly first serving. Also it disables the built in bitmap font which can really make kanji's look odd next to anti aliased hiragana etc. For most people this setting will be fine. If you're not happy, by all means leave out the embeddedbitmap setting.

    If you're still having problems consider the following:

    Find your locale (you should already know it)
    Code:
    locale | grep LANG=
    Then (with relevant changes)
    Code:
    sudo im-switch -z en_GB -s scim-anthy
    Note: You will need to change the en_GB to your relevant locale. Mine is en_GB (I'm a Brit living in Tokyo) but your one will no doubt be different)

    Also, you might wanna play with:

    Code:
    sudo dpkg-reconfigure fontconfig-config
    So with any luck you should have got Japanese working to a satisfactory level. I still have issues inputting into Java AWT and SWING components, but I guess you can't expect everything. If anyone has any information on this, please let me know!

    References:
    http://ubuntuforums.org/showthread.php?t=206280
    http://www.ubuntuforums.org/showthread.php?t=204500
    http://www.mrbass.org/linux/ubuntu/scim/
    http://www.ubuntuforums.org/showthread.php?t=127451
    Last edited by ryukent; February 8th, 2007 at 04:51 AM. Reason: Sazanami causes errors.

  2. #2
    Join Date
    Oct 2005
    Location
    Shanghai
    Beans
    1,181
    Distro
    Xubuntu 12.04 Precise Pangolin

    Re: HOWTO: Installing Japanese that looks nice on Ubuntu Edgy : 日本語

    Great Howto except that i couldnt add the repsoitory cause it asked for the public key, where do i get it from?

  3. #3
    Join Date
    Dec 2006
    Location
    All over the world!
    Beans
    Hidden!
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Lightbulb Re: HOWTO: Installing Japanese that looks nice on Ubuntu Edgy : 日本語

    Quote Originally Posted by seshomaru samma View Post
    Great Howto except that i couldnt add the repsoitory cause it asked for the public key, where do i get it from?
    After adding the repository and running the update, try:

    Code:
    sudo apt-get install ubuntu-ja-keyring
    Also note:
    If you are still not satisfied with the fonts, go to /etc/fonts directory and experiment with (after making backups of course) editing some of the extra .conf files. I found having the the one's that the msttcorefonts pack was not to my taste so I deleted most of the unnecessary files. You only really need fonts.conf and maybe local.conf. The other files just provide extra information. Note that the master fonts.conf file will also reference local.conf. You can rearrange the order under the Serif, Sans Serif and Monospace families to achieve the look you want. The order I've provided above should give you a clean looking 'on par with windows' effect though.

  4. #4
    Join Date
    Dec 2006
    Location
    All over the world!
    Beans
    Hidden!
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: HOWTO: Installing Japanese that looks nice on Ubuntu Edgy : 日本語

    OK, I've finally cracked how to get SCIM-Anthy to display properly in Java (and possibly many other apps).

    I ran nautilus in root, then went to /root/.scim directory and replaced the existing config file with the one that I had in my user home directory of an already set up user.

    Works a treat. I can now input Japanese in Java apps like netbeans!

  5. #5
    Join Date
    Dec 2006
    Location
    All over the world!
    Beans
    Hidden!
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: HOWTO: Installing Japanese that looks nice on Ubuntu Edgy : 日本語

    If you are having problems loading programs that use QT (like skype), try changing your QT_IM_MODULE environment variable to xim.


    export QT_IM_MODULE=xim

  6. #6
    Join Date
    Sep 2006
    Location
    Haddonfield, NJ
    Beans
    350
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: HOWTO: Installing Japanese that looks nice on Ubuntu Edgy : 日本語

    Hi, thanks for this great tutorial!

    I have one question: after setting this up, including your recommended .fonts.conf, the whole system is now using one of the Japanese fonts to display menus and texts in Ubuntu. It works fine, but it's not the prettiest English font. How can I set this this up while still maintaining the default look for the English fonts in Ubuntu? Or -- alternatively, how to uninstall this?

    Thanks again for posting this!
    Last edited by osarusan; January 23rd, 2007 at 02:33 AM.

  7. #7
    Join Date
    Dec 2006
    Location
    All over the world!
    Beans
    Hidden!
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Wink Re: HOWTO: Installing Japanese that looks nice on Ubuntu Edgy : 日本語

    Quote Originally Posted by osarusan View Post
    Hi, thanks for this great tutorial!

    I have one question: after setting this up, including your recommended .fonts.conf, the whole system is now using one of the Japanese fonts to display menus and texts in Ubuntu. It works fine, but it's not the prettiest English font. How can I set this this up while still maintaining the default look for the English fonts in Ubuntu? Or -- alternatively, how to uninstall this?

    Thanks again for posting this!
    Go to System / Preferences / Font, then make sure that all the fonts here, especially application and desktop fonts are specified as actual font names, not families. For example, I have specified 'Verdana' instead of simply 'Sans'.

  8. #8
    Join Date
    Sep 2006
    Location
    Haddonfield, NJ
    Beans
    350
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: HOWTO: Installing Japanese that looks nice on Ubuntu Edgy : 日本語

    Ah thanks! That helped.

    Verdana works perfectly, but for Monotype, the font still looks screwy -- as if the baseline is on a different level for each font. Which font are you using for the fixed width?
    (And additionally, why would this mess up the way Monotype displays?)

    Edit:Actually -- I found it out -- it's DejaVu Sans and Mono.

    Ok, I have one more question -- when Ihave windows open, each one gets its own input editor... is there a way to make it so they all use the same one, rather than having to individually change the preferences for each one? It would be nice if it worked as a universal input method editor, rather than per-program.

    Thanks again!
    Last edited by osarusan; January 23rd, 2007 at 05:10 AM.

  9. #9
    Join Date
    Dec 2006
    Location
    All over the world!
    Beans
    Hidden!
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: HOWTO: Installing Japanese that looks nice on Ubuntu Edgy : 日本語

    Quote Originally Posted by osarusan View Post
    Ah thanks! That helped.

    Verdana works perfectly, but for Monotype, the font still looks screwy -- as if the baseline is on a different level for each font. Which font are you using for the fixed width?
    (And additionally, why would this mess up the way Monotype displays?)

    Edit:Actually -- I found it out -- it's DejaVu Sans and Mono.

    Ok, I have one more question -- when Ihave windows open, each one gets its own input editor... is there a way to make it so they all use the same one, rather than having to individually change the preferences for each one? It would be nice if it worked as a universal input method editor, rather than per-program.

    Thanks again!
    I use Verdana for everything and Courier New for fixed width. As for the per program.... well you can set "Share same input method among all applications" in the global section of SCIM setup. However, as different Linux programs are using different desktop environment runtimes and handle input in different ways, it might remain necessary to have multiple SCIMs spawned.

  10. #10
    Join Date
    Dec 2006
    Location
    All over the world!
    Beans
    Hidden!
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Smile Re: HOWTO: Installing Japanese that looks nice on Ubuntu Edgy : 日本語

    I've rewritten this for Kubuntu. As Kubuntu uses SKIM, it needs to be set up differently if you want the input to work in all applications. Also, I've changed the font order to make latin scripts look nicer whilst maintaining Japanese character look.

    Please see the Kubuntu link if you are using the KDE desktop version of Ubuntu.

    http://kubuntuforums.net/forums/index.php?topic=13489.0

Page 1 of 4 123 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •