Pages

Friday, 28 December 2012

UTF8 in Debian/ubuntu

How to install fonts to system:
- There are many way to install fonts for X. But here is simplest way to install TrueType fonts:
+ Install ttmkfdir : apt-get install ttmkfdir
+ Copy all your fonts to some directory, for ex : ~/.fonts.
+ Create fonts.scale : cd ~/.fonts && ttmkfdir -o fonts.scale
+ Create fonts.dir : head -1 fonts.scale > fonts.dir && tail +2 fonts.scale | tac >> fonts.dir && cp fonts.dir fonts.scale
+ Add fonts path to xorg.conf.
* Choose fonts to display:
- Using xfontsel to choose which fonts you like. But if you want fonts display unicode character, recommend choose -iso10646.
- For ex : -misc-fixed-medium-r-*-*-15-140-75-75-*-90-iso10646-1
* UTF8 in terminal :
- Xterm, rxvt-unicode, … is terminal support to display unicode character.
- Add this line in .Xdefaults:
xterm*utf8: 1
xterm*font:-misc-fixed-medium-r-*-*-15-140-75-75-*-90-iso10646-1
- Type xrdb -merge .Xdefaults to load .Xdefaults to X.
* Input method for UTF8 :
- I using Scim, because it support many type method with many languages.
- Install Scim :
apt-get install scim scim-gtk2-immodule scim-qtimm
If you want asian input method support (include Vietnamese), install scim-m17n
- Config Scim : Export enviroment parameter in shell, usually add these lines in .xinitrc.
export LANG=en_US.UTF-8
export XMODIFIERS=@im=SCIM
export GTK_IM_MODULE=scim # to type in GTK+ apps
export QT_IM_MODULE=scim # to type in QT apps
export XIM_PROGRAM=”scim -d”
(if want type in terminal add this in .xinitrc : scim -d).