Linux中国 Linux中国门户站!
设为主页 设为主页
收藏本站 收藏本站
 
当前位置 :首页 ->Linux技术 ->发行版专区 ->Debian ->正文

英文Debian系统下正常显示和输入汉字

来源: 作者: 时间:2007-04-11 点击: [收藏] [投稿]









有时候为了避免乱码的出现,可在装debian时采用英文,然后进过几步简单的设置就能正确显示和输入汉字了,具体方法如下(需要注意的是我用的是KDE,GNOME下会有所不同):

首先要安装汉字包:

常用的汉字包主要有以下几种:

ttf-arphic-bkai00mp 繁体楷书
ttf-arphic-gbsn00lp 简体楷书
ttf-arphic-gkai00mp 简体宋体
ttf-arphic-uming 繁简宋体
ttf-arphic-ukai 繁简楷书

在文件/etc/apt/sources.list中加入这两行:

deb ftp://202.203.132.242/Debian/debian sarge main contrib non-free
deb ftp://202.203.132.242/Debian/debian sid main contrib non-free
然后用命令:
apt-get install ttf-arphic-bkai00mp ttf-arphic-gbsn00lp 
ttf-arphic-gkai00mp ttf-arphic-uming ttf-arphic-ukai

可以全装,也可以选自己想要的装,不过推荐全装。

一,这里用Windows下的字体,打开”控制面板“,双击”字体“,把里面自己喜欢的字体复制到Debian下,可以放在/usr/loca/share/fonts/目录下。

二,设置locale,运行locale命令查看当前使用的locale,用 locale -a查看可以使用的locale,我使用的是zh_CN.GB2312,可以使用命令dpkg-reconfigure locales配置locale,也可以在用户主目录下的.bashrc文件中加入这一行:

export LC_ALL=zh_CN.GB2312

三,点KDE的主菜单,选Actions下的settings->System Administration->Font Installer,这个程序就列出了系统里安装过了的字体,点Add Fonts...,会出现一个浏览的对话框,然后你选你自己存放字体的目录/usr/local/share/fonts/,点确定就把window下的字体添加到debian系统中了。

四,备份和修改/etc/X11/xorg.conf文件:

备份:cd /etc/X11/回车。

cp xorg.conf xorg.conf-back回车,这样就备份了这个文件,然后用任意一种编辑器编辑xorg.conf(注意有的系统不是这个文件)在里面加入这一行:

FontPath "/usr/local/share/fonts/"
Section "Files"
FontPath "/usr/local/share/fonts/"
FontPath "/usr/share/fonts/X11/misc"
FontPath "/usr/X11R6/lib/X11/fonts/misc"
FontPath "/usr/share/fonts/X11/cyrillic"
FontPath "/usr/X11R6/lib/X11/fonts/cyrillic"
FontPath "/usr/share/fonts/X11/100dpi/:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled"
FontPath "/usr/share/fonts/X11/75dpi/:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"
FontPath "/usr/share/fonts/X11/Type1"
FontPath "/usr/X11R6/lib/X11/fonts/Type1"
FontPath "/usr/share/fonts/X11/100dpi"
FontPath "/usr/X11R6/lib/X11/fonts/100dpi"
FontPath "/usr/share/fonts/X11/75dpi"
FontPath "/usr/X11R6/lib/X11/fonts/75dpi"

然后保存退出,重启动X就行了。

我的配置效果不比windows下的字体差。安装中文输入法,有两个,scim和fcitx可选,我选的是fcitx,用命令:

apt-get install fcitx

安装此输入法,然后在/etc/X11/Xsession.d/目录下95im-launch在里面写入:

export XMODIFIERS=@im=fcitx 
fcitx

这样fcitx就随桌面自动启动了。

 如果您对本文有任何疑问或者建议,请到讨论区发表您的意见: >> 论坛入口 <<



上一篇:Debian和Gentoo包管理机制比较及延伸   下一篇:Debian下通过SSHFS/SHFS挂载远程文件

文章评论】 【收藏本文】 【推荐好友】 【打印本文】 【我要投稿】 【论坛讨论
更多相关文章
Power by linux-cn.com 粤ICP备05006655号