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

来源:互联网 发布:淘宝怎么开全球购店铺 编辑:程序博客网 时间:2024/05/15 15:00
有时候为了避免乱码的出现,可在装debian时采用英文,然后进过几步简单的设置就能正确显示和输入汉字了,具体方法如下(需要注意的是我用的是KDE,GNOME下会有所不同):

  首先要安装汉字包:

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

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

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

deb [url]ftp://202.203.132.242/Debian/debian[/url] sarge main contrib non-free
deb [url]ftp://202.203.132.242/Debian/debian[/url] 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就随桌面自动启动了。

  最后随便说几句,如果你在安装时选了“简体中文”,但是有时候桌面上也可能全部或部分汉字不能正常显示,最常见的是显示为????或者是一个方框,里面有四个数字。这时用这种方法可能也会凑效。 >>查看完整文章




查看完整全文,请点击http://www.phpvip.cn/thread-252-1-1.html

精彩文章尽在海纳之家

http://www.phpvip.cn
原创粉丝点击