ubuntu chinese fonts solutions

 

Back to Ubuntu main page 

 

Setup Traditional Chinese Environment

sudo apt-get install language-pack-zh language-pack-gnome-zh language-support-zh libchewing3 scim-chewing scim-tables-zh gstreamer0.10*

 Install Microsoft Core Fonts

Microsoft Windows comes bundled with a number of core True Type fonts. License restrictions prevent the Microsoft fonts from being distributed directly as part of Ubuntu, but Microsoft does make them available for free download directly from its web site.

Before Installing these fonts you need to make sure you have universe and multiverse repositories in your source list

sudo apt-get install msttcorefonts

This will give you the core fonts, but if there are other True Type fonts that you want installed, it is as easy as copying the font files to the ~/.fonts/ directory.

Install Windows True type fonts

You can download and install thousands of free windows .ttf true type fonts from the web and install and use them in Ubuntu Linux.Once you downloaded the .ttf fonts you need to open file browser using Ctrl-L then type fonts:/// and click Open.

Now drag your new True Type font from your desktop or file manager into the font-list window, and it will be automatically installed and made available to applications through Defoma the next time they start up.

Or, 

Download mingliu.ttc 

Download kaiu.ttf

cd Desktop or cd 桌面

sudo cp kaiu.ttf mingliu.ttc /usr/local/share/fonts

sudo chmod 775 /usr/local/share/fonts/*.ttf
sudo chmod 775 /
usr/local/share/fonts/*.ttc

sudo cp kaiu.ttf mingliu.ttc /usr/share/fonts/truetype

sudo chmod 775 /usr/share/fonts/truetype/*.ttf
sudo chmod 775 /usr/share/fonts/
truetype/*.ttc

fc-cache -v -f /usr/share/fonts/

sudo touch /usr/share/fonts/*/*/*

sudo touch /usr/share/fonts/*/*

sudo touch /usr/share/fonts/*

sudo touch /usr/share/fonts/

 

Install Ubuntu Title Font

sudo apt-get install ttf-ubuntu-title

安裝 New Sung, UMing 與 UKai
sudo apt-get update
sudo apt-get install  ttf-arphic-ukai ttf-arphic-uming ttf-arphic-newsung
sudo fc-cache -v


安裝 Opendesktop 字型

wget ftp://ftp.opendesktop.org.tw/odp/ODOFonts/OpenFonts/opendesktop-fonts-1.4.2.tar.gz
tar xvzf opendesktop-fonts-1.4.2.tar.gz
cd opendesktop-fonts-1.4.2
sudo cp odosung.ttc odokai-ExtB.ttf odokai.ttf odosung-ExtB.ttf /usr/local/share/fonts
sudo fc-cache -v


安裝 cwTTF 字型
wget http://cle.linux.org.tw/fonts/cwttf/deb/ttf-cwtex-center-cwfs_1.0-1_all.deb
wget http://cle.linux.org.tw/fonts/cwttf/deb/ttf-cwtex-center-cwheib_1.0-1_all.deb
wget http://cle.linux.org.tw/fonts/cwttf/deb/ttf-cwtex-center-cwkai_1.0-1_all.deb
wget http://cle.linux.org.tw/fonts/cwttf/deb/ttf-cwtex-center-cwming_1.0-1_all.deb
wget http://cle.linux.org.tw/fonts/cwttf/deb/ttf-cwtex-center-cwyen_1.0-1_all.deb
sudo dpkg -i ttf-cwtex-center-cwfs_1.0-1_all.deb
sudo dpkg -i ttf-cwtex-center-cwheib_1.0-1_all.deb
sudo dpkg -i ttf-cwtex-center-cwkai_1.0-1_all.deb
sudo dpkg -i ttf-cwtex-center-cwming_1.0-1_all.deb
sudo dpkg -i ttf-cwtex-center-cwyen_1.0-1_all.deb
sudo fc-cache -v


安裝文泉驛點陣字體
sudo apt-get install xfonts-wqy
sudo fc-cache -v

Set Java Chinese Fonts
cd /usr/lib/jvm/java-1.5.0-sun/jre/lib/fonts
sudo ln -s /usr/share/fonts/arphic fallback
cd /usr/lib/jvm/java-6-sun/jre/lib/fonts
sudo ln -s /usr/share/fonts/arphic fallback

Install gcin for Chinese IME
sudo apt-get update
sudo apt-get install gcin

or download gcin_1.4.3-0~1_i386.deb here

Install fcitx
sudo apt-get install im-switch fcitx
sudo im-switch -s fcitx -z default
im-switch -s fcitx -z default

If there is conflict with SCIM, try following:
sudo gedit /usr/lib/gtk-2.0/2.10.0/immodule-files.d/scim-gtk2-immodule.immodules

Replace "ja:ko:zh" with "ja:ko"
# automatically generated by dh_gtkmodules, do not edit
“/usr/lib/gtk-2.0/2.10.0/immodules/im-scim.so”
“scim” “SCIM Input Method” “scim” “/usr/share/locale” “ja:ko”

 

im-switch syntax:

For scim
im-switch -s scim

For gcin
im-switch -s gcin

For fxtix

im-switch -s fcitx -z default 


gcin的使用


gcin預設是詞音輸入法,使用方式和新注音類似,最大不同的地方在於gcin選字方框是浮動的,不像新注音會直接把字打到文件上。利用鍵盤上的 [ Ctrl ] + [ Space空白鍵 ] 就可以進行中英文切換。出現如下的選字方框時,代表正在使用詞音輸入法狀態。


除了像嘸蝦米之類的商業軟體,需自行安裝處理外,預設支援大多數中文主流輸入法。Ex.倉頡、大易、行列輸入法。可以直接利用 [ Shift ] + [ Ctrl ] 組合鍵切換之。如下為倉頡輸入法狀態。


可利用 [ Shift ] + [ (號碼) ] 的方式,將字詞選進來。此新注音不支援。如下圖,利用 [ Shift ] + [ 2 ] 輸入「今日事,今日畢」的預選字詞。


另外,在剛剛提到的選字方框中的空白地方(不是藍色的地方喔),壓一下滑鼠右鍵,就會出現gcin的設定視窗。而按一下滑鼠左鍵,就會跳出標點符號鍵盤。


呵呵~~裡面有些設定,就保留給讀者自己摸索吧! :)

詞音標點符號輸入: (取發音的第一個注音符號 + 輕聲(‧) or 1/2/3/輕 聲) (如果要輸入注音符號, 就按向下鍵去選)
 ㄐ 。 (句點)
ㄉ , (逗號)
ㄇ : (冒號)
ㄨ‧ ? (問號)
ㄈ ; (分號)
ㄊ ! (驚嘆號)
ㄉˋ 、 (頓號)
ㄉˊ ‧ (點)
ㄑ‧ $ (錢)
ㄒ‧ * (星)
# 以下是 0.2.0 新增的注音
ㄣ‧ 『 (引號)
ㄣ 『 (因與恩同音,應避免使用)
ㄣˊ 』
ㄣˇ 「
ㄣˋ 」
ㄌ2 – (連接號)
ㄇ3 《 (書'名'號)
ㄇ4 》
ㄌ … (省'略'號)
ㄆ4 — (破折號)
ㄒ ℃ (攝氏 Celsius)
ㄒ2 ㏄ (毫升)

Note:當然......還有更偷懶的,直接用 [ Shift ] + [ (半型符號) ] 就好囉! :p

 
嗯......不知道大家有沒有喜歡上gcin了呢?如果有興趣的朋友,可以去維基百科中的 http://wiki.debian.org.tw/index.php/gcin 去看看,裡面有相當豐富的資料喔!
:)

 

Last section is for fontconfig

sudo gedit /etc/fonts/conf.d/10-myfonts.conf

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">

<!-- conf.d/myfont.conf -->
<fontconfig>

<dir>/usr/share/fonts</dir>
<dir>/usr/share/fonts/local</dir>
<dir>/usr/local/share/fonts</dir>
<dir>~/.fonts</dir>
<!--加入點陣字體路徑-->
<dir>/usr/X11R6/lib/X11/fonts</dir>

<!--所有字型預設樣式-->
<match target="font">
<edit name="antialias" mode="assign">
<bool>true</bool>
</edit>
<edit name="hinting" mode="assign">
<bool>false</bool>
</edit>
<edit name="autohint" mode="assign">
<bool>false</bool>
</edit>
</match>

<!--打開中文粗體。註,這個問題似乎已不會再發生。所以以下設定也許是沒必要的。-->
<match target="font">
<test name="family" compare="contains">
<string>宋</string>
<string>明</string>
<string>楷</string>
<string>Song</string>
<string>Sun</string>
<string>Ming</string>
<string>Kai</string>
</test>
<test compare="more_eq" target="pattern" name="weight">
<int>180</int>
</test>
<edit mode="assign" name="embolden">
<bool>true</bool>
</edit>
</match>

<!-- 關閉小字AA -->
<match target="font">
<test name="pixelsize" compare="less">
<double>12</double>
</test>
<edit name="antialias" mode="assign">
<bool>false</bool>
</edit>
</match>

<!-- 關閉宋體、明體小字AA -->
<match target="font">
<test name="family" compare="contains">
<string>宋</string>
<string>明</string>
<string>Song</string>
<string>Sun</string>
<string>Ming</string>
</test>
<test name="pixelsize" compare="less_eq">
<double>20</double>
</test>
<edit name="antialias" mode="assign">
<bool>false</bool>
</edit>
</match>

<!-- 解決中文字體英文間距過寬 -->
<match target="font">
<test target="pattern" name="lang" compare="contains">
<string>zh-tw</string>
<string>zh-cn</string>
<string>ja</string>
<string>ko</string>
</test>
<edit name="spacing">
<const>proportional</const>
</edit>
<edit name="globaladvance">
<bool>false</bool>
</edit>
</match>

<!--設定中文最小字號-->
<match target="font">
<test name="family" compare="contains">
<string>宋</string>
<string>明</string>
<string>楷</string>
<string>Song</string>
<string>Sun</string>
<string>Ming</string>
<string>Kai</string>
</test>
<test name="pixelsize" compare="more_eq">
<double>8</double>
</test>
<test name="pixelsize" compare="less_eq">
<double>12</double>
</test>
<edit name="pixelsize" compare="eq">
<double>12</double>
</edit>
</match>

<!--適應中文用戶的用字習慣-->
<alias>
<family>serif</family>
<prefer>
<family>DejaVu Serif</family>
<family>Bitstream Vera Serif</family>
<family>Times New Roman</family>
<family>Times</family>
<family>AR PL New Sung</family>
<family>AR PL ShanHeiSun Uni</family>
<family>Kochi Mincho</family>
<family>UnBatang</family>
<family>Baekmuk Batang</family>
</prefer>
</alias>

<alias>
<family>sans-serif</family>
<prefer>
<family>DejaVu Sans</family>
<family>Bitstream Vera Sans</family>
<family>Lucida Grande</family>
<family>Helvetica</family>
<family>Arial</family>
<family>Verdana</family>
<family>AR PL New Sung</family>
<family>AR PL ShanHeiSun Uni</family>
<family>AR PL New Kai</family>
<family>AR PL ZenKai Uni</family>
<family>Kochi Gothic</family>
<family>UnDotum</family>
<family>Baekmuk Dotum</family>
</prefer>
</alias>

<alias>
<family>monospace</family>
<prefer>
<family>DejaVu Sans Mono</family>
<family>Bitstream Vera Sans Mono</family>
<family>Andale Mono</family>
<family>Courier New</family>
<family>Courier</family>
<family>AR PL New Sung Mono</family>
<family>AR PL New Sung</family>
<family>AR PL ShanHeiSun Uni</family>
<family>Kochi Gothic</family>
<family>Baekmuk Dotum</family>
</prefer>
</alias>

<alias>
<family>細明體</family>
<prefer>
<family>AR PL New Sung</family>
<family>AR PL ShanHeiSun Uni</family>
</prefer>
</alias>

<alias>
<family>新細明體</family>
<prefer>
<family>AR PL New Sung</family>
<family>AR PL ShanHeiSun Uni</family>
</prefer>
</alias>

<alias>
<family>標楷體</family>
<prefer>
<family>AR PL New Kai</family>
<family>AR PL KaitiM Big5</family>
<family>AR PL KaitiM GB</family>
<family>AR PL ZenKai Uni</family>
</prefer>
</alias>

</fontconfig>