分享
 
 
 

新手一次搞定RedHat8.0simsun字体的shell程序

王朝other·作者佚名  2006-11-23
窄屏简体版  字體: |||超大  

我根据翔羽的<完美的redhat8,,,>的文章,编了这个bash程序,我在这里不能上传,所以

把源文件剪贴拷贝到这里。你可以把#!/bin/bash直到reboot之间的内容拷贝到一个文件中,比如sm.sh

把他放到/usr/local/temp里面,chmod 755 sm.sh,让它可执行。

然后,把simsun.ttc, SimSun18030.ttc, tahoma.ttf, tahomabd.ttf四个文件

拷贝到上述目录中,执行这个脚本程序:./sm.sh

然后就重起动了,然后就能用simsun了。注意两点:要在刚用简体汉字装完,没作任何汉化情况下作;

要用root作。

小心!!!我没测试过!!!哪位好心大侠给测试一下噢:)再次向翔羽致敬致谢!

下面是程序:

#!/bin/bash

#

#change rh8 chinese fonts to simsun

#This is a GPL sript. The content comes form Xiang Yu. Thanks him.

#usage:

#1, install rh8 and select simplified chinese.

#2, make a temple directory in anywhere you prefer.

# for example /usr/local/temp

# copy 'where/it/has/the/windows_fonts/simsun.ttc' and

#all of these fonts, simsun.ttc、SimSun18030.ttc、tahoma.ttf and tahomabd.ttf

# to this temp place /usr/local/temp

#3, copy this shell script into this directory.

#4, run it

#5, set the fonts to your most prefered ones in gnome, kde and xmms and others.

#first, put the fonts to the correct dir.

export CDIR=/usr/X11R6/lib/X11/fonts/TrueType

mkdir $CDIR

#copy the fonts to it

cp simsun.ttc $CDIR/simsun.ttf

cp SimSun18030.ttc $CDIR/SimSun18030.ttf

cp t* $CDIR/

#copy encodings

cp /usr/X11R6/lib/X11/fonts/encodings/encodings.dir $CDIR/

#make the fonts.dir

echo '29

simsun.ttf -misc-fixed-medium-r-normal--0-0-0-0-c-0-gb2312.1980-0

SimSun18030.ttf -misc-SimSun18030-medium-r-normal--0-0-0-0-c-0-gb18030.2000-0

ai=0.3:SimSun18030.ttf -misc-SimSun18030-medium-i-normal--0-0-0-0-c-0-gb18030.2000-0

ds=y:SimSun18030.ttf -misc-SimSun18030-bold-r-normal--0-0-0-0-c-0-gb18030.2000-0

ds=y:ai=0.3:SimSun18030.ttf -misc-SimSun18030-bold-i-normal--0-0-0-0-c-0-gb18030.2000-0

simsun.ttf -misc-SimSun-medium-r-normal--0-0-0-0-c-0-gb2312.1980-0

ai=0.3:simsun.ttf -misc-SimSun-medium-i-normal--0-0-0-0-c-0-gb2312.1980-0

ds=y:simsun.ttf -misc-SimSun-bold-r-normal--0-0-0-0-c-0-gb2312.1980-0

ds=y:ai=0.3:simsun.ttf -misc-SimSun-bold-i-normal--0-0-0-0-c-0-gb2312.1980-0

tahoma.ttf -misc-SimSun-medium-r-normal--0-0-0-0-p-0-iso8859-1

ai=0.3:tahoma.ttf -misc-SimSun-medium-i-normal--0-0-0-0-p-0-iso8859-1

tahomabd.ttf -misc-SimSun-bold-r-normal--0-0-0-0-p-0-iso8859-1

ai=0.3:tahomabd.ttf -misc-SimSun-bold-i-normal--0-0-0-0-p-0-iso8859-1

simsun.ttf -misc-SimSun-medium-r-normal--0-0-0-0-p-0-gbk-0

ai=0.3:simsun.ttf -misc-SimSun-medium-i-normal--0-0-0-0-p-0-gbk-0

ds=y:simsun.ttf -misc-SimSun-bold-r-normal--0-0-0-0-p-0-gbk-0

ds=y:ai=0.3:simsun.ttf -misc-SimSun-bold-i-normal--0-0-0-0-p-0-gbk-0

simsun.ttf -misc-SimSun-medium-r-normal--0-0-0-0-p-0-fcd8859-15

ai=0.3:simsun.ttf -misc-SimSun-medium-i-normal--0-0-0-0-p-0-fcd8859-15

ds=y:simsun.ttf -misc-SimSun-bold-r-normal--0-0-0-0-p-0-fcd8859-15

ds=y:ai=0.3:simsun.ttf -misc-SimSun-bold-i-normal--0-0-0-0-p-0-fcd8859-15

simsun.ttf -misc-SimSun-medium-r-normal--0-0-0-0-p-0-iso8859-15

ai=0.3:simsun.ttf -misc-SimSun-medium-i-normal--0-0-0-0-p-0-iso8859-15

ds=y:simsun.ttf -misc-SimSun-bold-r-normal--0-0-0-0-p-0-iso8859-15

ds=y:ai=0.3:simsun.ttf -misc-SimSun-bold-i-normal--0-0-0-0-p-0-iso8859-15

simsun.ttf -misc-SimSun-medium-r-normal--0-0-0-0-c-0-iso10646-1

ai=0.3:simsun.ttf -misc-SimSun-medium-i-normal--0-0-0-0-c-0-iso10646-1

ds=y:simsun.ttf -misc-SimSun-bold-r-normal--0-0-0-0-c-0-iso10646-1

ds=y:ai=0.3:simsun.ttf -misc-SimSun-bold-i-normal--0-0-0-0-c-0-iso10646-1' > $CDIR/fonts.dir

#make the fonts.scale

cat $CDIR/fonts.dir > $CDIR/fonts.scale

#modify /etc/X11/XF86Config

sed -e '/^Section[[:space:]]*"Files"/,/^EndSection/{

/^[[:space:]]*FontPath[[:space:]]*"\/usr\/X11R6\/lib\/X11\/fonts\/TrueType"/d

/RgbPath/a\

FontPath "\/usr\/X11R6\/lib\/X11\/fonts\/TrueType"

}' -e '/Section[[:space:]]*"Module"/,/^EndSection/{

/^[[:space:]]*Load[[:space:]]*"freetype"/d

/^[[:space:]]*Load[[:space:]]*"record"/d

/^[[:space:]]*Load[[:space:]]*"type1"/d

s/EndSection/ Load "xtt"\

EndSection/

}' /etc/X11/XF86Config > ~/tmpfile

cat ~/tmpfile > /etc/X11/XF86Config

#modify gtkrc.zh_CN

sed -e '/style[[:space:]]*"gtk-default-zh-cn"/,/class[[:space:]]*"GtkWidget"[[:space:]]*style[[:space:]]*"gtk-default-zh-cn"/{

s/^[[:space:]]*fontset[[:space:]]*.*"/ fontset = "-*-*-medium-r-normal--12-*-*-*-*-*-iso10646-1,*-r-*"/

}' /etc/gtk/gtkrc.zh_CN > ~/tmpfile

cat ~/tmpfile > /etc/gtk/gtkrc.zh_CN

#modify gnome/gtkrc

sed -e 's/^[[:space:]]*fontset[[:space:]]*=.*"/ fontset = "-misc-SimSun-medium-r-normal--12-*-*-*-*-*-iso10646-1"/' /etc/gnome/gtkrc.zh_CN > ~/tmpfile

cat ~/tmpfile > /etc/gnome/gtkrc.zh_CN

#modify /etc/fonts/fonts.conf

sed -e 's/<dir>\/usr\/X11R6\/lib\/X11\/fonts\/Type1<\/dir>/<dir>\/usr\/X11R6\/lib\/X11\/fonts\/TrueType<\/dir>\

<dir>\/usr\/X11R6\/lib\/X11\/fonts\/Type1<\/dir>/' /etc/fonts/fonts.conf > ~/tmpfile

cat ~/tmpfile > /etc/fonts/fonts.conf

sed -e '/If[[:space:]]*the[[:space:]]*font/,/<\/match>/s/<string>.*<\/string>/<string>SimSun<\/string>/' /etc/fonts/fonts.conf > ~/tmpfile

cat ~/tmpfile > /etc/fonts/fonts.conf

sed -e '/<string>zh<\/string>/,/<\/edit>/s/<bool>.*<\/bool>/<bool>true<\/bool>/' /etc/fonts/fonts.conf > ~/tmpfile

cat ~/tmpfile > /etc/fonts/fonts.conf

sed -e '/<family>monospace<\/family>/,/<\/prefer>/{

/<prefer>/a\

<family>SimSun<\/family>

}' /etc/fonts/fonts.conf > ~/tmpfile

cat ~/tmpfile > /etc/fonts/fonts.conf

#modify /usr/lib/Chinput/Chinput.ad

sed -e 's/chinput\.gb18030font[[:space:]]*=[[:space:]]*.*/chinput\.gb18030font = -misc-SimSun-medium-r-normal--0-0-0-0-c-0-iso10646-1/' -e 's/xft\.font\.family[[:space:]]*=[[:space:]]*zysong18030/xft\.font\.family = SimSun/' /usr/lib/Chinput/Chinput.ad > ~/tmpfile

cat ~/tmpfile > /usr/lib/Chinput/Chinput.ad

#cp the files for xmms in the system default locale gb18030

mkdir /usr/share/locale/zh_CN.GB18030

cp -a /usr/share/locale/zh_CN.GB2312/* /usr/share/locale/zh_CN.GB18030/

#Gao Ding it!

reboot

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有