文字界面显示中文的软件zhcon的使用

fedora文本界面默认不支持中文,所以需要一些辅助软件来实现这个功能,在这里推荐zhcon

1.yum安装
fedora 8可以直接使用yum安装这个软件
# yum search zhcon
zhcon.i386 : A Fast Console CJK System Using FrameBuffer
zhcon.i386 : A Fast Console CJK System Using FrameBuffer

#yum install zhcon.i386

2.使用
安装完毕之后,在文本界面下直接执行
#zhcon
便可以进入中文显示模式,如果系统的默认编码是gbk或者gb2312,到此就可以正确的显示中文了,但如果是utf-8,则需要在执行指令时在后面添加如下参数
#zhcon --utf8

至此便可以在文本界面下正确显示中文了,如果嫌每次进入文本界面都要执行一下这个指令很麻烦的话,可以把这个指令添加到init.d中开机自动执行。
————————————————————————————————————————
其实由于zhcon已经停止开发很久了,而且对中文输入的支持很不好,所以并不是一个在文本界面下显示中文的最佳
选择,cce要比他优秀很多,之所以题出来,就是因为自fedora6以后,zhcon就被加入到了yum库中,安装/卸载都
十分方便,如果不是2.6内核的linux系统,zhcon的表现还是不错的
还有一点需要说明的是zhcon最早是针对freebsd作的开发,所以查看/etc/zhcon.conf时,很多参数都是在freebsd下才能生效,我会在有时间时翻译一下这个配置文件的说明,当然,前提是没有找到他人翻译的成果的情况下。

 

 

一、解压缩、打补丁:

[root@fish installing]# tar zxvf zhcon-0.2.5.tar.gz
[root@fish installing]# gunzip zhcon-0.2.5-to-0.2.6.diff.gz
[root@fish installing]# cd zhcon-0.2.5/
[root@fish zhcon-0.2.5]# patch -p1 < ../zhcon-0.2.5-to-0.2.6.diff

二、编译、安装:

[root@fish zhcon-0.2.5]# ./configure
[root@fish zhcon-0.2.5]# make && make install
[root@fish zhcon-0.2.5]# whereis zhcon
zhcon: /usr/local/bin/zhcon /usr/local/etc/zhcon.conf /usr/local/lib/zhcon

三、查看帮助:

[root@fish zhcon-0.2.5]# zhcon --help
zhcon

A Fast CJK Console Environment

Usage: zhcon [OPTIONS]... [FILES]...

  -h, --help        Print help and exit
  -V, --version     Print version and exit
      --utf8        use iconv filter to convert UTF-8 stream from/to system
                      encoding  (default=off)
      --drv=STRING  specify video driver (auto, fb, ggi, vga)  (default=`auto')


四、查看配置:

[root@fish zhcon-0.2.5]# gedit /usr/local/etc/zhcon.conf

#this is config file for zhcon
#it can be named as ~/.zhconrc or /etc/zhcon.conf
#you can edit it manually

#zhconpath = /usr/local/lib/zhcon/

#unicon(3.x) path
uniconpath = /usr/lib/unicon/

#defaultencode: default encoding can be :gb2312,gbk,big5,jis,ksc
defaultencode = gb2312

#autoencode: auto detect current Chinese encoding(GB2312 or BIG5)
#when autoencode is set zhcon will try to detect current Chinese encoding
#after idle 1 second and change current Chinese encoding to
#GB2312 or BIG5.This function is useful if you are viewing many text files
#with different encoding type.
#auto,auto-gb,auto-big5,manual
autoencode = manual

#screen resolution
#NOTE:
# 1) These only works on FreeBSD. On Linux these options will be IGNORED!
# 2) If your FreeBSD kernel has VESA support compiled in(with
#    "options VESA") and your display adapter support VESA(most cards will
#    do), you can set color_depth to 8 or higher. This means you can use
#    640x480x256 colors, 640x480x65536 colors, 800x600x256 colors...etc
#    BUT you will not able to use 640x480x16 colors! (Of course I don't
#    think you will want to run 16 colors mode at all :))
# 3) If your FreeBSD kernel has not VESA support(or you even don't know
#    what's kernel or what's VESA), you can only set color_depth to 4.
#    That is, you can only run 16 colors mode(VERY slowly).
# 4) Ok, if you don't understand me at all, it's OK. Just go and find a
#    FreeBSD wizard and ask him to compile a new kernel with VESA support
#    for you and ... emmmm ... explain all these stuff to you ...
#
x_resolution = 640
y_resolution = 480
# 4 bits = 16 colors, 8 bits = 256 colors, 16 bits = 64K colors, and so on..
# By defalut, 640X480X16 color is used to support as many video cards as
# possible. zhcon works very SLOWLY under this mode. You should try setting
# color_depth=8 to use 256 color (VESA mode) after recompiling your kernel
# with VESA support to gain most out of your hardware.
color_depth = 4

#blanklineheight must >= 0
blanklineheight = 1

#0, default(block); 1, none; 2, underline
#3, 1/3 block; 4, 1/2 block; 5, 2/3 block; 6, block
cursortype = 6

beep = on

#whether to display startup message
startupmsg = on

#whether to enter prompt mode when start
#you can enter prompt mode by press CTRL-ALT-0
promptmode = off

# set font name, all font must be placed in PREFIX/lib/zhcon/
# for use with 24 pixel font
# ascfont = font/asc24.bpsf
# gbfont = font/gb-24-kai.bpsf

ascfont = font/asc16.bpsf
gbfont = font/gb-16.bpsf
gbkfont = font/gbk-16.bpsf
big5font = font/big5-16.bpsf
jisfont = font/jis-16.bpsf
kscfont = font/ksc-16.bpsf

#inputstyle: overspot or nativebar
inputstyle = overspot

# color scheme format
# text's fore, back, color1, color2, frame's light, dark color
# change push style to pop by swap frame's light/dark color
# red style = 15,4,11,14,12,0
# blue style = 15,1,11,14,9,0
# white style = 0,7,1,1,15,8
overspotcolor = 0,7,1,1,15,8
nativebarcolor = 15,4,11,14,0,12

showtips = on

#change input method here
#the first ime is the default ime when press CTRL_SPACE
#only the first nine imes are avaiable to zhcon
#you can add more ime from Chinput's config file
#format: ime = imename,module,table,encode,type
#imename := <input method's name>
#module := <module file name>
#table := <table file name>
#encode := gb2312 | gbk | big5
#type := native | unicon
ime = 全拼,,input/winpy.mb,gb2312,native
ime = 五笔,,input/wb.mb,gb2312,native
ime = 双拼,,input/winsp.mb,gb2312,native
ime = ︽30,,input/big5-ary30.mb,big5,native
ime = 緀,,input/big5-cj.mb,big5,native
ime = 猔,,input/big5-phone.mb,big5,native
ime = 礚郊μ,,input/big5-liu5.mb,big5,native
ime = 智能拼音,cce_pinyin.so,cce,gb2312,unicon
ime = GBK拼音,TL_hzinput.so,gbk/gbkpy_mb.tab,gbk,unicon
ime = 自然码,TL_hzinput.so,gb/zrm-2.tab,gb2312,unicon
ime = 惧块な,TL_hzinput.so,big5/pinyin.tab,big5,unicon
ime = 緀块,TL_hzinput.so,big5/cj.tab,big5,unicon
ime = 虏块,TL_hzinput.so,big5/simplex.tab,big5,unicon
ime = 全拼2,,input/py.mb,gb2312,native
ime = 双拼2,,input/py.mb,gb2312,native
ime = 大众,,input/dzm.mb,gb2312,native
ime = 英中,,input/ed.mb,gb2312,native
ime = 简拼,,input/jp.mb,gb2312,native
ime = 普通,,input/pt.mb,gb2312,native
ime = 五笔二维,,input/wbew.mb,gb2312,native
ime = 五笔划,,input/wbh.mb,gb2312,native
ime = 繁体仓颉,,input/cjf.mb,gb2312,native
ime = 简体仓颉,,input/cjj.mb,gb2312,native

五、修改配置:

[root@fish zhcon-0.2.5]# cp /usr/local/etc/zhcon.conf /usr/local/etc/zhcon.conf.myBak
[root@fish zhcon-0.2.5]# vim /usr/local/etc/zhcon.conf

修改如下部分:
#x_resolution = 640
#y_resolution = 480
x_resolution = 800
y_resolution = 600

#color_depth = 4
color_depth = 8

六、使用UTF-8编码:
在字符终端模式下:
[lwg@fish ~]$ zhcon --utf8

 

 

ps: 我的配置文件在:/etc/zhcon.conf                     字体文件在:/usr/share/zhcon/font/

好的,我可以为您提供编译安装 Wine、Pidgin、gFTP 和 Zhcon 中文虚拟控制台的基本步骤。请注意,这些是相对复杂的过程,需要一定的技术知识。在进行此操作之前,请务必备份您的数据,以防止意外数据丢失。 安装 Wine: 1. 下载 Wine 的源码包。 您可以从 Wine 官方网站或其他可靠的站点下载您需要的 Wine 源码包。 2. 解压并进入源码包目录。 使用 tar 命令解压下载的源码包,并进入解压后的目录。 3. 配置编译选项。 使用 ./configure 命令来配置编译选项。您可以根据需要使用不同的选项来定制您的 Wine 安装。 4. 编译并安装。 使用 make 命令开始编译 Wine。这可能需要一些时间,具体取决于您的系统配置和编译选项。完成编译后,使用 make install 命令来安装 Wine。 安装 Pidgin: 1. 下载 Pidgin 的源码包。 您可以从 Pidgin 官方网站或其他可靠的站点下载您需要的 Pidgin 源码包。 2. 解压并进入源码包目录。 使用 tar 命令解压下载的源码包,并进入解压后的目录。 3. 配置编译选项。 使用 ./configure 命令来配置编译选项。您可以根据需要使用不同的选项来定制您的 Pidgin 安装。 4. 编译并安装。 使用 make 命令开始编译 Pidgin。这可能需要一些时间,具体取决于您的系统配置和编译选项。完成编译后,使用 make install 命令来安装 Pidgin。 安装 gFTP: 1. 下载 gFTP 的源码包。 您可以从 gFTP 官方网站或其他可靠的站点下载您需要的 gFTP 源码包。 2. 解压并进入源码包目录。 使用 tar 命令解压下载的源码包,并进入解压后的目录。 3. 配置编译选项。 使用 ./configure 命令来配置编译选项。您可以根据需要使用不同的选项来定制您的 gFTP 安装。 4. 编译并安装。 使用 make 命令开始编译 gFTP。这可能需要一些时间,具体取决于您的系统配置和编译选项。完成编译后,使用 make install 命令来安装 gFTP。 安装 Zhcon 中文虚拟控制台: 1. 下载 Zhcon 的源码包。 您可以从 Zhcon 官方网站或其他可靠的站点下载您需要的 Zhcon 源码包。 2. 解压并进入源码包目录。 使用 tar 命令解压下载的源码包,并进入解压后的目录。 3. 配置编译选项。 使用 ./configure 命令来配置编译选项。您可以根据需要使用不同的选项来定制您的 Zhcon 安装。 4. 编译并安装。 使用 make 命令开始编译 Zhcon。这可能需要一些时间,具体取决于您的系统配置和编译选项。完成编译后,使用 make install 命令来安装 Zhcon。 希望这些步骤可以帮助您成功编译安装 Wine、Pidgin、gFTP 和 Zhcon 中文虚拟控制台。如果您有任何疑问或问题,请随时向我提出。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值