In Linux, the shell program that handles RedHat8.0simsun fonts once in Chinese

Source: Internet
Author: User
Article title: shell program for RedHat8.0simsun in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
According to Xiang Yu's <完美的redhat8,,,> And compiled this bash program. I cannot upload it here, so
Copy the source file to this directory. You can put #! /Bin/bash: copy content between reboot to a file, such as sm. sh.
Put it in/usr/local/temp, chmod 755 sm. sh, and make it executable.
Then, the simsun. ttc, SimSun18030.ttc, tahoma. ttf, tahomabd. ttf files
Copy to the preceding directory and run the script program:./sm. sh.
Then restart and simsun can be used. Note: you must finish the installation without any Chinese characters;
Use root.
Be careful !!! I have not tested it !!! Which kind of good man would like to give a test? oh, again, I would like to extend my thanks to Xiang Yu!
The following is a program:
#! /Bin/bash
#
# Change rh8 chinese fonts to simsun
# This is a GPL srept. 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. 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/\
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. conf
Sed-e's/ \/Usr \/X11R6 \/lib \/X11 \/fonts \/Type1 <\/dir>/ \/Usr \/X11R6 \/lib \/X11 \/fonts \/TrueType <\/dir> \
   \/Usr \/X11R6 \/lib \/X11 \/fonts \/Type1 <\/dir>/'/etc/fonts. conf> ~ /Tmpfile
Cat ~ /Tmpfile>/etc/fonts. conf
Sed-e '/If [[: space:] * the [[: space:] * font/,/<\/match>/s/ . * <\/String>/ SimSun <\/string>/'/etc/fonts. conf> ~ /Tmpfile
Cat ~ /Tmpfile>/etc/fonts. conf
Sed-e '/ Zh <\/string>/,/<\/edit>/s/ . * <\/Bool>/ True <\/bool>/'/etc/fonts. conf> ~ /Tmpfile
Cat ~ /Tmpfile>/etc/fonts. conf
Sed-e '/ Monospace <\/family>/,/<\/prefer> /{
/ /\
   SimSun <\/family>
} '/Etc/fonts. conf> ~ /Tmpfile
Cat ~ /Tmpfile>/etc/fonts. conf
# Modify/usr/lib/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. ad> ~ /Tmpfile
Cat ~ /Tmpfile>/usr/lib/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
  
  
  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.