Add a new font for RedhatLinux

Source: Internet
Author: User
Article Title: add a new font for RedhatLinux. 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.
The following content includes:
  
1. add a font for the two font subsystems of Redhat
2. Enlightenment to display Chinese characters
3. Java Chinese problems:
  
-JBuilder Chinese problems
-J2SDK Chinese problems
-J2RE Chinese problems
  
You just need to pick what you need.
  
Add a new font for Redhat Linux
  
[Note]
The following process is successfully tested on Redhat 9.0.
  
Prepare the fonts to be installed, such as simsun. ttc, tahoma. ttf...
Add the font for the core X font sub-system and fontconfig font sub-system as described in the release notes:
  
Add a font for the core X font subsystem
  
[Note]
The following sections should also apply to versions earlier than Redhat 9.0, because the core X font subsystem exists.
In the version so far.
  
"If you want to add a new font to your Red Hat Linux 9 system
Set
, You must specify the required steps. For the core X font subsystem, you must:
1. create/usr/share/fonts/local/Directory (if it does not exist ):
Mkdir/usr/share/fonts/local /"
  
-This step is okay.
  
"If you must create/usr/share/fonts/local/, you must add it to the X font server
Road
Path:
Chkfontpath -- add/usr/share/fonts/local /"
  
-If you created/usr/share/fonts/local/, an error will be prompted when you execute this command.
Because the system cannot find the fonts. dir file in this directory, and then it will not add... but it doesn't matter,
This step jumps over and is done after step 3.
  
"2. copy the new font file to/usr/share/fonts/local"
  
-Do as you like.
  
"3. use the following command to update the font information:
Ttmkfdir-d/usr/share/fonts/local/-o/usr/share/fonts/local/fonts. scale"
  
-Do as follows. Then:
1) copy fonts. scale to a copy of fonts. dir.
2) chkfontpath -- add/usr/share/fonts/local/
  
"4. run the following command to restart the xfs font server:
Service xfs reload"
  
-I did not succeed in this step, because I found that redhat 9 does not contain the service Command.
Use a stupid solution: Exit X and then startx.
  
After the above steps are completed, all the gtk 1.2 programs have the relevant font section (such as xmms font settings ).
And the new fonts we need, such as simsun and tahoma, can be directly used in the program.
For example, if we want to use simsum for Chinese characters in the song list and tahoma for English, we can do this:
  
1) first, check the option "Use fontsets" in the xmms Fonts-enable xmms to support dual-byte
Chinese font;
2) browse the font in the playlist area and select simsum:
-Misc-simsun-medium-r-normal-*-120-*-c-*-KOI8-R
(You don't need to copy this file. select simsun and it will come out)
  
Tahoma should be used for English fonts. tips:
  
Cut down this section "-misc-simsun-medium-r-normal-*-120-*-c-*-KOI8-R" ^ x,
Select tahoma as the font, and the following will appear:
  
-Microsoft-tahoma-medium-r-normal-*-120-*-p-*-viscii1.1-1
  
Now, add a comma to the end and paste the cut section ^ v into the following:
  
-Microsoft-tahoma-medium-r-normal-*-120-*-p-*-viscii1.1-1,
-Misc-simsun-medium-r-normal-*-120-*-c-*-KOI8-R
  
Save this line, so the song list will use simsum for Chinese and tahoma for English.
Copy the text in the Main Window below this line (to hook it with "Use X font"), then the xmms Main Window
The font in the mouth (like the font of the rolling back and forth song information) is the same as that in the song list.
  
Note: What I just talked about is the internal program, just like the xmms song list, and the program itself, that is, the xmms self-
The window is still bold and large, and you need to change the gtk font settings:
  
1) use the root account: vi/etc/gtkrc. zh_CN
2) put the original:
  
Fontset = "-adobe-helvetica-medium-r-normal -- 16-*-ISO8859-1,
-*-Medium-r-normal -- 16-*-gb2312.1980-0, *-r -*"
  
The font is the same as the one we used in xmms:
  
Fontset =
"-Microsoft-tahoma-medium-r-normal-*-120-*-p-*-viscii1.1-1,
-Misc-simsun-medium-r-normal-*-120-*-c-*-KOI8-R"
  
3) save and exit, turn off the xmms programs, and re-open them. The effect will come out! Enjoy!
  
Add font for fontconfig font subsystem
  
[Note]
In addition to the "graphical font installation" section, the following section is unique to Rehat 9.0. others should be available in earlier versions.
You can try it.
  
This part is much simpler. see the redhat 9 release notes:
  
"Adding a new font to the fontconfig font subsystem is simple and clear. you only need to copy the new font
/Usr/share/fonts/Directory (individual users can copy the new font ~ /. Fonts/directory to repair
Change their font configuration)
  
After the new font is copied, use fc-cache to update the font information cache:
  
Fc-cache
  
(Here it should be/usr/share/fonts/or ~ /. Fonts/directory .) "
  
-I copied the font in this way ~ /. Fonts/The following is successful. (do not want to use root user, hh)
  
"Individual users can also install fonts graphically. The method is: Browse fonts: // in Nautilus, and then
Drag and drop the new font file. "
  
-I failed to use this method. no matter whether I use a common user or a root user, I cannot use the font file.
Copy or drag and drop the file to the fonts: // folder of Nautilus. if you do not know the reason, you have to give up.
  
After the first method is successfully added, the new font can be freely used for setting the font in the gtk 2 program.
For example, in the control center, change all application fonts to simsum. (in addition, I found that
Simsun has the best effect and is clear without using a single color. you can consider using it)
  
In general, adding a new font for Redhat Linux is nothing too difficult and mysterious. I have done it myself.
After
I think it is not as difficult as I think, especially the font part of the gtk 1.2 program. I don't have to change so much as I 've said.
File,
  
Actually, you only need to add the font and change the font to/etc/gtkrc. zh_CN.
  
Enlightenment to display Chinese characters
  
It is also simple. on the premise above, find the E topic you are currently using, for example
  
~ /. Enlightenment/themes/AquaX/
The simplest way to access this directory is:
Gedit textclass. cfg
  
Use the replace function of gedit to replace all font strings, such:
  
"-*-Helvetica-bold-r-normal-*-120 -*-*-*-*-*-*"
  
All replace the same as xmms:
  
-Microsoft-tahoma-medium-r-normal-*-120-*-p-*-viscii1.1-1,
-Misc-simsun-medium-r-normal-*-120-*-c-*-KOI8-R"
  
Save and exit, clear the cache of E, Restart E, done.
  
Java Chinese display
  
1. JBuilder Chinese problems
  
Vi/etc/profile
  
Add:
  
JAVA_FONTS =/path/to/your/zhfonts/
Export JAVA_FONTS
  
For example, we need to use the simsum and tahoma fonts we just made, because we have placed them in:
/Usr/share/fonts/local, so here you can fill in:
  
JAVA_FONTS =/usr/share/fonts/local
  
Note: JBuilder obviously uses the fontconfig font Subsystem. Therefore, let it recognize it.
Fonts. scale and fonts. dir are required.
Compared to the font folder of the core X font sub-system above, that is, my ~ /. Fonts only
The font file and a file named "fonts. cache-1" can be compared and understood.
  
The program opened by JBuilder can display Chinese characters, but there is a problem with the JBuilder's Chinese characters. below:
Modify the font configuration of JBuilder. for example, if my JBuilder is installed in:
  
~ /Apps/Devs/JBuilder
  
So:
Vi ~ /Apps/Devs/JBuilder8/jdk1.4/jre/lib/font. properties
  
Put something like this:
  
Serif.0 =-B & h-lucidabright-medium-r-normal -- *-% d-*-p-*-ISO8859-1
Serif.1 = -- standard symbols l-medium-r-normal -- *-% d-*-p-*-urw-fontspecific
  
Serif. italic.0 =-B & h-lucidabright-medium-I-normal -- *-% d-*-p-*-ISO8859-1
Serif. italic.1 = -- standard symbols l-medium-r-normal -- *-% d-*-p-*-urw-fontsp
Ecific
  
Replace all:
  
Serif.0 =-microsoft-tahoma-medium-r-normal-*-120-*-p-*-viscii1.1-1
Serif.1 =-misc-simsun-medium-r-normal-*-120-*-c-*-KOI8-R
  
Serif. italic.0 =-microsoft-tahoma-medium-r-normal-*-120-*-p-*-viscii1.1-1
Serif. italic.1 =-misc-simsun-medium-r-normal-*-120-*-c-*-KOI8-R
  
(Use the same xmms font as above)
  
All these "*. 0 = .." describe the fonts used in English.
All "*. 1 =..." describes the font used in Chinese.
  
Save and exit. The English in JBuilder is tahoma, and all Chinese characters are simsun.
Naturally, because JAVA_FONTS has been set, all Java applications can be found normally.
Chinese font and display.
Related Article

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.