Page 1 of 12 12311 ... LastLast
Results 1 to 10 of 116

Thread: HOWTO: Installing Japanese Input and Font Setup in Ubuntu 8.04 (Hardy) using SCIM 日本語

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

    Question HOWTO: Installing Japanese Input and Font Setup in Ubuntu 8.04 (Hardy) using SCIM 日本語

    HOWTO: Installing Japanese Input and Font Setup in Ubuntu 8.04 (Hardy) using SCIM: 日本語

    Installing Japanese Input and Superior Font Setup in Ubuntu

    Introduction

    This is a guide to setting up Japanese for Ubuntu 8.04 Hardy. It is intended as a complete guide encompassing all elements required for using Japanese on any language installation of Ubuntu. It covers input (SCIM-Anthy) and configuring the Japanese fonts. There are other guides around for older versions of Ubuntu or that use the alternative UIM (see other guide). This guide is intended to cover everything. Please note that Kubuntu requires slightly different steps. Please follow the relevant page accordingly. This is an updated version based on the original 6.10 one, but with some sections changed. Please note that if you follow this guide, your fonts will be reconfigured. This might mean losing some font settings you may have made. With each version of Ubuntu, there are certain changes, this guide is not the same as the 7.10 version.

    Issues Involved

    There are two main 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 matching style.

    Japanese Input with SCIM

    This section covers setting up the Japanese input system using SCIM Anthy. This involves, downloading, installing and configuring it so that you can use it in non-Japanese locales (e.g. your system is in English).

    Setting Up Repositories

    First lets make sure you have the correct repositories installed in order to automatically download the relevant packs. Make sure you have the Universe and Multiverse repositories switched on. This can be done in 'Synaptic Package Manager' under the repositories tab. Also, you need the Japanese repository too. Open the repositories list file:

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

    Code:
    deb http://archive.ubuntulinux.jp/ubuntu-ja hardy/
    Note that you will need to change 'hardy' if you are using a different version from 8.04. Now update your repos with:

    Code:
    sudo apt-get update
    At this stage, you will probably get an error saying that the repository is not validated. Ignore this for now. The following step will correct it. After adding the repository and running the update, you also need to add a keyring for the new location:

    Code:
    sudo apt-get install ubuntu-ja-keyring
    Adding Ubuntu Language Support

    Go to System / Administration / Language Support and select Japanese. This should install the basics. Make sure you've also turned on support for inputting complex characters.

    Making SCIM available under a non-Japanese login

    Now you want to make SCIM (Language input system) available in your English (or other language) login and not just the Japanese one. Since 8.04, ubuntu will make it available in GTK applications, but if you want to run non-GTK applications such as KDE or pure X software such as those Java based you'll need to make a few changes. If you are running a US locale, it might work with defaults, but any other locale will almost certainly need registering. First open the scim global settings file:

    Code:
    gksudo gedit ~/.scim/global
    Add the line:

    Code:
    /SupportedUnicodeLocales = en_US.UTF-8,en_GB.UTF-8
    The above line adds support for US and UK locales. If you are using a different locale, you will need to change / add the relevant locale. You can find out the name of your current locale by entering:

    Code:
    locale
    In my case (UK) it returns LANG=en_GB.UTF-8. Add the necessary to the above line.

    IMPORTANT NOTE: SCIM is very unforgiving with this line. Note that there is NO SPACE between the "," and "en_GB". If you put a space there, it will ignore everything after. Therefore make sure the following locales are separated by a comma only.

    At this stage you'll probably need to log out and back in again. Open a text editor and hit ctrl+space. SCIM should pop up ready to type in Japanese.

    Adding handwriting recognition support for looking up Kanjis

    After adding the above repository, you should be able to install the 'Tomoe' handwriting recognition addon for scim using:

    Code:
    sudo apt-get install scim-tomoe
    Unfortunately, Tomoe is set to load dictionaries that correspond to the locale, so if you're not using a Japanese locale, you'll need to create a link to the dictionary manually.

    Code:
    cd /usr/share/tomoe/recognizer
    sudo cp handwriting-ja.xml handwriting-en.xml
    Where 'en' corresponds to your locale type. In my case (en_GB.UTF-8) it is 'en'. For you, it might be different. You can look it up as mentioned above.

    Now that Tomoe is installed, it is accessible on the SCIM menu under the 'SCIM Command Menu' and listed as 'Handwriting recognition'.

    Setting up the system to display Japanese characters properly

    OK, now you've got Japanese input installed (hopefully). It might require rebooting xwindows (CTRL+ALT+Backspace). But for me, I really didn't like the horrible fonts that defaulted. Particularly the fact that hiragana / katakana characters are rendered differently from kanjis and the poor quality of smaller sizes annoys me. The main reason for this is that the fonts provided do not always have a full set of kanjis, with default settings the kanjis are rendered as bitmaps and the hiragana and katakana as vectors.

    At lower font sizes, it would be impossible to render all the strokes in very complicated characters without blurring and this causes a readability problem. This can be overcome with bitmap alternatives at a low end. Certain strokes are omitted and the shape is actually changed in order to improve readability. It's not simply a case of rendering the same vector in a smaller size. Some true type fonts contain bitmap alternatives that can be automatically substituted at the low end. This is a common approach and is adopted by Windows, MacOS and other electronic devices in Asia such as mobile phones. Here's the next step.

    Downloading External Fonts

    Unfortunately, I am very disappointed in the Ubuntu selection and you will almost certainly want this to be changed to MSGothic and MSMincho. They contain a superior vector and bitmap selection. These are Microsoft fonts, but they are freely available to use and are actually from a company called Ricoh. They need to be downloaded and installed manually. They can be found at the following page.

    http://www.linux.ryukent.co.uk/show.php?id=24

    So download and extract the files 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:
    gksudo "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/msjapanesefonts
    Rebuilding the font cache

    Now we need to rebuild the fonts cache:

    Code:
    sudo fc-cache -f -v
    Setting up the font order

    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:
    gksudo gedit ~/.fonts.conf
    It should read as follows:

    Code:
    <?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>
    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 enables the built in bitmap font which can really make kanji's more readable and also enables the bitmap version of hiragana and katakana so that they don't look blurry anti-aliased next to clear bitmap kanjis. For most people this setting will be fine. If you're not happy, by all means leave out the embeddedbitmap setting or change it to false.

    To finish things off, I'd suggest making sure in System / Preferences / Appearance / Fonts, you've got subpixel smoothing on and after clicking on details, hinting is set to 'full'.

    If you have any additional questions, please don't hesitate to message me in this forum. I'm always happy to help, though I make take a little while responding. 頑張ってください - RyuKent
    Last edited by ryukent; November 25th, 2008 at 11:10 PM. Reason: added gedit to the global line

  2. #2
    Join Date
    Sep 2007
    Beans
    247
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO: Installing Japanese Input and Font Setup in Ubuntu 8.04 (Hardy) using SCIM

    thanks for the tutorial.
    however, there's something I don't understand: what exactly do we gain by adding the ubuntu-ja repository? Is there any software which is not already available in the ubuntu repos?

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

    Re: HOWTO: Installing Japanese Input and Font Setup in Ubuntu 8.04 (Hardy) using SCIM

    Adding the repos was in previous versions of this guide as they contained fonts that weren't in the normal repos. Some are no longer available, so I've omitted that section. All should work fine without the 'ja' repository, however I find that updates to the Japanese system are released faster in this repository. Also there are a number of other useful programs that you can only find there. In order to keep the guide a complete Japanese setup tutorial, I thought it necessary to leave that section in.

  4. #4
    Join Date
    Apr 2007
    Location
    /dev/random
    Beans
    3,052

    Re: HOWTO: Installing Japanese Input and Font Setup in Ubuntu 8.04 (Hardy) using SCIM

    Awesome tutorial, many thanks. Bitmaps were just the thing I was looking for. (...though by chance happened to enable earlier after furious googling.)

    質問!

    • Are these Ricoh fonts exact copies of the ones found on a Windows system? Or new-and-improved versions? Because I nicked my whole font directory from my Windows partition, which got me all kinds of peculiar fonts, including MS Mincho and Gothic.

    • After adding the repository, should I install any extra hitherto-deselected-or-unavailable packages? I see it updated scim, anthy and the bridge packages, which is always nice.

    • I made a symlink towards my ~/fonts.conf file at /etc/fonts/fonts/conf.d/99-zor.conf. Will this make the setting system-wide? Should it perhaps be named 01-zor.conf? I figured the higher the number the later it would be included, and as such override any previous settings.

    • Quote Originally Posted by me, in my ignorance
      Semi-relevant, but how do I enter the Japanese quotation signs? Entering normal " quotes just gives me the suggestions ”, “ and the unmodified ".
      edit: Pah, found it; [ and ] becomes 「 and 」.

    • Any further steps to take for us Kubuntulings? On a side note, I didn't seem to have a .fonts.conf file to begin with, unless my memory is sorely failing me.

    • Must the .fonts.conf entry be MS 明朝 and ゴシック or does MS Mincho and Gothic suffice? (More out of interest.)

    • The limit at which it stops using bitmaps seems to be at 16px (vectoring above). Is there a way of altering this? (Also out of interest.)

    • Is there a way to get scim enabled at the login screen? Likely not? (Yep, interest.)
    Last edited by Zorael; May 30th, 2008 at 10:36 PM.
    ...

  5. #5
    Join Date
    Oct 2007
    Beans
    71
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: HOWTO: Installing Japanese Input and Font Setup in Ubuntu 8.04 (Hardy) using SCIM

    RyuKent, you are an asset to the ubuntu and linux community, thanks. (I'll also soon be posting a question to the effective TangoBlaster thread.)

    However, some comments:

    I was able to get SCIM to work for Japanese input on my English installation simply through System > Administration > Langauge Support , however to date there may have been varying degrees of success with that method: http://ubuntuforums.org/showthread.php?t=783036

    Second, do you use a handwriting recognition program to look up kanji? The very useful program tomoe is not in my default Hardy repo's for some reason. (I'm located in Japan, thus use the Japan servers) ..
    To be honest, this is one aspect of Hardy which is pushing me back towards Fedora..

    http://ubuntuforums.org/showthread.php?t=783673 tomoe and kanjipad

    Any thoughts or comments much appreciated

  6. #6
    Join Date
    Sep 2007
    Beans
    247
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO: Installing Japanese Input and Font Setup in Ubuntu 8.04 (Hardy) using SCIM

    Browsing the repo recommended by Ryukent I noticed that tomoe is available:
    http://archive.ubuntulinux.jp/ubuntu-ja/hardy/

  7. #7
    Join Date
    Apr 2007
    Location
    /dev/random
    Beans
    3,052

    Re: HOWTO: Installing Japanese Input and Font Setup in Ubuntu 8.04 (Hardy) using SCIM

    I couldn't get tomoe to work while under a non-Japanese locale. Modifying /usr/bin/scim-tomoe makes it work *if* started manually, but if I right-click the skim toolbar and start it from there it still didn't work. It would seem it calls tomoe directly instead of through the wrapper script in /usr/bin/. Note, this is with KDE and skim.
    Code:
    $ cat /usr/bin/scim-tomoe
    #!/bin/sh
    # scim-tomoe launcher
    <truncated comments>
    # $Id: scim-tomoe.in,v 1.2 2006/12/11 06:28:42 makeinu Exp $
    
    prefix=/usr
    exec_prefix=${prefix}
    libdir=${exec_prefix}/lib
    includedir=${prefix}/include
    localedir=${datarootdir}/locale
    datarootdir=${prefix}/share
    datadir=${datarootdir}
    sysconfdir=${prefix}/etc
    
    # zor
    export LANG=ja_JP.UTF-8
    export LC_MESSAGES=ja_JP.UTF-8
    
    /usr/lib/scim-1.0/scim-helper-launcher tomoe b1bfe2b4-6930-41b0-8c07-d05bce8c92e2 $*
    (Nevermind the # zor, I always add that so I can see when it's something manually modified, when memory fails me.)

    Again, this made it work when running scim-tomoe manually, from a run box or a terminal, but not when having skim start it for me. So I copied the recognition dictionary.
    Code:
    zorael@sunspire:~$ cd /usr/share/tomoe/recognizer
    zorael@sunspire:/usr/share/tomoe/recognizer$ ls
    handwriting-ja.xml  handwriting-zh_CN.xml
    zorael@sunspire:/usr/share/tomoe/recognizer$ sudo cp handwriting-ja.xml handwriting-en.xml
    zorael@sunspire:/usr/share/tomoe/recognizer$
    Oh, and yay for skim-scim-anthy. :>
    ...

  8. #8
    Join Date
    May 2008
    Beans
    10

    Re: HOWTO: Installing Japanese Input and Font Setup in Ubuntu 8.04 (Hardy) using SCIM

    Hi – I've followed ryukent's instructions (excellent job!) and everything works great except for one program. I'm new to Ubuntu (and Linux) so I'm not sure where to go from here and was hoping someone could point me in the right direction.

    I'm unable to get SCIM-Anthy to work with Anki (a flash card study program). I'm running Ubuntu 8.04 and have the latest version of Anki (0.9.5.7) installed along with all the dependencies listed in the package manager (at >= versions). When I try to start Anthy (either with ctrl + space or by clicking on the SCIM keyboard icon) while using Anki, I don't get the Anthy's menu and SCIM stays set on English/Keyboard. Other people have reported having no issue with Anki & SCIM-Anthy. Below are my are installed packages and the text from /etc/X11/xinit/xinput.d/scim. They seem to match everyone else's that I've found discussing similar issues. Any ideas on where I should look next? Thanks in advance.
    Code:
     dpkg --get-selections | grep scim
    
    libscim8c2a					install
    
    scim						install
    
    scim-anthy					install
    
    scim-bridge-agent				install
    
    scim-bridge-client-gtk			install
    
    scim-bridge-client-qt				install
    
    scim-bridge-client-qt4			install
    
    scim-gtk2-immodule				install
    
    scim-modules-socket				install
    
    
    dpkg --get-selections | grep -i qt4
    
    libqt4-core					install
    
    libqt4-gui					install
    
    libqt4-qt3support				install
    
    libqt4-sql					install
    
    python-qt4					install
    
    python-qt4-common				install
    
    scim-bridge-client-qt4			install
    
    
    
    sudo gedit /etc/X11/xinit/xinput.d/scim
    
    XIM=SCIM
    
    XIM_PROGRAM=/usr/bin/scim
    
    XIM_ARGS="-d"
    
    XIM_PROGRAM_SETS_ITSELF_AS_DAEMON=yes
    
    GTK_IM_MODULE="scim-bridge"
    
    QT_IM_MODULE="scim-bridge"
    
    DEPENDS="scim,scim-anthy|scim-canna|scim-chewing|scim-pinyin|scim-hangle|scim-prime|scim-skk|scim-tables-additional|scim-m17n|scim-uim|scim-tables-ja|scim-tables-ko|scim-tables-zh"
    Sean Dun

  9. #9
    Join Date
    Sep 2007
    Beans
    247
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO: Installing Japanese Input and Font Setup in Ubuntu 8.04 (Hardy) using SCIM

    since anki uses qt, what's the output of:
    Code:
    export | grep QT
    are other non-gtk apps working?

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

    Re: HOWTO: Installing Japanese Input and Font Setup in Ubuntu 8.04 (Hardy) using SCIM

    Sean,

    If you're using a QT app like Anki and you're only getting the keyboard and are unable to select Anthy, it is probably because your global file doesn't have your locale enabled. SCIM should have no problem sending data to standard QT input boxes. Have you checked other QT4 apps??

    If that doesn't work, it could be that the program was written with some hard coded algorithm that ignores non alphabet text, though if its a kanji flash card program, I doubt it.

Page 1 of 12 12311 ... LastLast

Tags for this Thread

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
  •