个人工具

“UbuntuHelp:Installing Japanese Input and Fonts”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
 
(未显示同一用户的1个中间版本)
第1行: 第1行:
 
{{From|https://help.ubuntu.com/community/Installing_Japanese_Input_and_Fonts}}
 
{{From|https://help.ubuntu.com/community/Installing_Japanese_Input_and_Fonts}}
 
{{Languages|UbuntuHelp:Installing_Japanese_Input_and_Fonts}}
 
{{Languages|UbuntuHelp:Installing_Japanese_Input_and_Fonts}}
'''HOWTO: Installing Japanese that looks nice on Ubuntu Edgy : 日本語'''
+
Please see:
Installing Japanese Input and Superior Font Setup in Ubuntu
+
https://help.ubuntu.com/community/JapaneseInput
== Introduction ==
+
This is a guide to setting up Japanese for Ubuntu 6.10 Edgy. 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. They tend to cover elements only. This guide is intended to cover everything. Please note that Kubuntu requires slightly different steps. Please follow the relevant page accordingly.
+
== 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 non-handwriting 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:
+
<pre><nowiki>
+
gksudo gedit /etc/apt/sources.list
+
</nowiki></pre>
+
Add the following line at the bottom:
+
<pre><nowiki>
+
deb http://archive.ubuntulinux.jp/ubuntu-ja edgy/
+
</nowiki></pre>
+
Now update your repos with:
+
<pre><nowiki>
+
sudo apt-get update
+
</nowiki></pre>
+
After adding the repository and running the update, you also need to add a keyring for the new location:
+
<pre><nowiki>
+
sudo apt-get install ubuntu-ja-keyring
+
</nowiki></pre>
+
=== Adding Ubuntu Language Support ===
+
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:
+
<pre><nowiki>
+
sudo apt-get install uim anthy scim-gtk2-immodule scim-uim scim-chinese scim-hangul scim-tables-zh scim-tables-ja scim-tables-ko
+
</nowiki></pre>
+
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.
+
=== Making SCIM available under a non-Japanese login ===
+
Now you want to make SCIM (Language input system) available in your English (or other lang) login and not just the Japanese one. First open the scim_startup file:
+
<pre><nowiki>
+
gksudo gedit /etc/X11/Xsession.d/74custom-scim_startup
+
</nowiki></pre>
+
Add these lines:
+
<pre><nowiki>
+
export XMODIFIERS="@im=SCIM"
+
export GTK_IM_MODULE="scim"
+
export XIM_PROGRAM="scim -d"
+
export QT_IM_MODULE="scim"
+
</nowiki></pre>
+
== Setting up the system to display Japanese characters properly ==
+
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. 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.
+
=== Downloading Repository Fonts ===
+
<pre><nowiki>
+
sudo apt-get install msttcorefonts ttf-dejavu ipafont ipamonafont ttf-arphic-ukai ttf-arphic-uming
+
</nowiki></pre>
+
This will install the Microsoft (Freeware) core fonts and a number of other useful fonts, specifically ones that support Japanese unicode characters.
+
=== 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. 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/preview.pl/fonts/msgothic.0.zip
+
http://www.themeworld.com/cgi-bin/preview.pl/fonts/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:
+
<pre><nowiki>
+
sudo nautilus --browser
+
</nowiki></pre>
+
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:
+
<pre><nowiki>
+
/usr/share/fonts/truetype/msttcorefonts
+
</nowiki></pre>
+
=== Rebuilding the font cache ===
+
Now we need to rebuild the fonts cache:
+
<pre><nowiki>
+
sudo fc-cache -f -v
+
</nowiki></pre>
+
=== 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:
+
<pre><nowiki>
+
gksudo gedit ~/.fonts.conf
+
</nowiki></pre>
+
It should read as follows:
+
<pre><nowiki>
+
<?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>
+
</nowiki></pre>
+
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 ==
+
If you're still having problems consider the following:
+
=== General ===
+
Find your locale (you should already know it)
+
<pre><nowiki>
+
locale | grep LANG=
+
</nowiki></pre>
+
Then (with relevant changes)
+
<pre><nowiki>
+
sudo im-switch -z en_GB -s scim-anthy
+
</nowiki></pre>
+
Note: You will need to change the en_GB to your relevant locale. Mine is en_GB but your one will no doubt be different. This will not work on most systems, but is worth a try.
+
Also, you might wanna play with:
+
<pre><nowiki>
+
sudo dpkg-reconfigure fontconfig-config
+
</nowiki></pre>
+
=== Java ===
+
If you are having problems inputting Japanese into some application only (especially Java ones) you might need to update the SCIM settings for the root user too. This can be done by replacing the existing config file in  /root/.scim with one from your home directory that you have already set up correctly. Of course you will need root privileges to do that.
+
=== QT ===
+
If you are having problems loading programs that use QT (like skype), try changing your QT_IM_MODULE environment variable to xim (see above).
+
<pre><nowiki>
+
export QT_IM_MODULE=xim
+
</nowiki></pre>
+
=== References ===
+
http://ubuntuforums.org/showthread.php?t=338991
+
----
+
[[category:CategoryDocumentation]] [[category:CategoryDocumentation]]
+
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2008年12月16日 (二) 19:01的最新版本

Please see: https://help.ubuntu.com/community/JapaneseInput