Linux OS XFree86 font beautification Solution

Source: Internet
Author: User
Article Title: XFree86 font beautification solution for linux operating systems. 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.
   1. update records
  
* 0.1: Feb. 21,199 9: first announcement.
* 0.11: Feb. 27,199 9: Put copyright.
* 0.12: Jun. 10,199 9: Put in request for assistance.
* 0.20: Sep. 14,199 9: Add a section about xfs for the redhat user.
* 1.0: Nov. 23,199 9: Convert the Document to SGML format and send it to the Document Project in Linux.
   2. XF86Config File
To solve the font problem, you must first check the XF86Config file. (Usually put in/usr/X11/lib/X11/XF86Config or/etc/X11/XF86Config ). Have you guessed it? The most important part of the FontPath file is the FontPath. Before we study it, we 'd better check other settings of X first. Incorrect Screen Settings are more troublesome than incorrect font settings. Make sure that the update frequency (refresh rate) of your screen has been set to the maximum value in the normal use range (85Hz is good, 75Hz is normal, 60Hz is uncomfortable ).
2.1 set FontPath
  
Use your most convenient text editor to edit XF86Config. At the beginning of the file, you should see something similar to the following:
  
FontPath "/usr/X11R6/lib/X11/fonts/misc /"
FontPath "/usr/X11R6/lib/X11/fonts/Type1 /"
FontPath "/usr/X11R6/lib/X11/fonts/Speedo /"
FontPath "/usr/X11R6/lib/X11/fonts/75 dpi /"
FontPath "/usr/X11R6/lib/X11/fonts/100 dpi /"
  
FontPath tells X to go there to find the font used for display on the screen. Sequence is important. When an X application requires some fonts for X, X server usually prefers to use the fonts in use. Then it looks at the FontPath and uses the first font that can meet the requirements of X client.
  
The default FontPath usually places the 75 dpi font in front of the 100 dpi font. If you have a high-resolution screen, this indicates very small words. The first method you need to use is to reconcile the 75 dpi and 100 dpi FontPath.
  
FontPath "/usr/X11R6/lib/X11/fonts/misc /"
FontPath "/usr/X11R6/lib/X11/fonts/Type1 /"
FontPath "/usr/X11R6/lib/X11/fonts/Speedo /"
FontPath "/usr/X11R6/lib/X11/fonts/100 dpi /"
FontPath "/usr/X11R6/lib/X11/fonts/75 dpi /"
  
Then point out that you prefer to use a dot matrix word that cannot be scaled. If you have used Netscape or other programs that use a large font to display titles, you will find that these fonts are jagged. This is ugly and needs to be modified. Therefore, unscaled is added at the end of misc, 100 dpi, and 75 dpi. If you want to, you can also use words that can be scaled or cannot be scaled at the same time, as long as you put the FontPath of words that cannot be scaled in front, tell X to say if possible, try to use words that cannot be scaled.
  
FontPath "/usr/X11R6/lib/X11/fonts/misc: unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/100 dpi: unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/75 dpi: unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/Type1"
FontPath "/usr/X11R6/lib/X11/fonts/Speedo"
FontPath "/usr/X11R6/lib/X11/fonts/misc"
FontPath "/usr/X11R6/lib/X11/fonts/ 100 dpi"
FontPath "/usr/X11R6/lib/X11/fonts/75 dpi"
  
After making these changes, restart X. Is the desktop already pretty?
  
   3. X server command column options (command line options)
The following is how to adjust the command column options of X server. You will want to use-dpi to specify the display resolution at intervals. Many systems now use high-resolution displays, and may use 100 dpi.
  
If you start X on the console, Type
  
Startx-dpi 100
  
If you use the xdm GUI, You need to edit your/usr/X11/lib/X11/xdm/Xservers file. There is an Xserver command column in it. My file contains the following line
  
: 0 local/usr/X11R6/bin/X-dpi 100-gamma 1.6
  
You can find more information in the manpage of X and Xserver.
  
   4. TrueType font (a few good things for Windows)
Because the guys in Redmond are very concerned about the appearance of their software rather than the content, they add support for TrueType fonts in Windows. Windows 95 and other Windows systems contain Arial, Times New Roman, and Courier New. They are about to wait for Helvetica, Times, and Courier. TrueType fonts can be scaled, so they look nice when zoomed in, and they are also well adjusted, so they are still readable when zoomed out. There are many Windows applications with several dozen TrueType fonts. Don't rush to take your Windows CD to the microwave. You have to get these fonts first.
4.1 xfstt
  
Unfortunately, XFree86 does not internally support TrueType fonts, so you must add them yourself. The simplest way is to use xfstt, A TrueType font server without authorization. Note: Here, "no" means "free". Strictly speaking, "no" means "free)
Installation
  
Xfstt is easy to install. First download the tarball from the website. The latest version is http://metalab.unc.edu/pub/Linux/X11/fonts/Xfstt-0.9.10.tgz
  
Unlock the tarball.
  
Tar-zxvf Xfstt-0.9.10.tgz
  
Then compile and install it. The INSTALL file has a simple description. There is a brain-less method of make; make install. After the installation is complete, copy the TrueType fonts obtained from various pipelines to/usr/ttfonts. Type the following command to start xfstt
  
Xfstt -- sync # update the xfstt font database
Xfstt & # execute xfstt in the background
  
Then type
  
Xset + fp unix/: 7100 # Use xfstt for X
  
Or Add the following command in your XF86Config file to allow X to use this service.
  
FontPath "unix/: 7100"
  
Adjust the default font size
  
If your TrueType font looks quite small, the following commands may be helpful.
  
Add-dpi to the X server command column (See Chapter 3rd ).
  
Use -- res to tell xfstt to increase the default resolution. Use the following command
  
Xfstt -- res 120
  
4.2 xfs
  
Xfs is another font server choice. It is already included in the distribution based on RedHat. Xfs is based on FreeType Font library and provides functions similar to xfstt. Xfs can not only handle TrueType and Type 1 fonts, but also the original X fonts.
Install
  
The first step is to add the TrueType font to your linux system. Su is a Super User. Create a directory to store these fonts:
  
Mkdir/usr/share/fonts/ttfonts
  
Put the font in this directory. You can copy from your Windows System
  
Cp/mnt/win/path_to_fonts/* ttf/usr/share/fonts/ttfonts/
  
Or download it directly from Microsoft.
  
These fonts are self-extracted zip files. You can still install
  
Unzip
  
Note that the font file name must be in lower case. A fast and easy conversion method is to copy them to a DOS (FAT16) file system and then copy them back. DOS does not process uppercase letters. Another method that will be used more like linuxer is to first enter the directory where the font is stored, and then type:
  
Ls * TTF | while read f
Do
[-F "$ f"] & mv-f "$ f" "'echo \" $ f \ "| tr A-Z a-Z '"
Done
  
When you type each row, a ">" prompt is displayed. Press return at the end of each row. Note punctuation-those "backquotes" are important. After the TrueType font is correctly installed, run the following command as a Super User:
  
Ttmkfdir-o fonts. scale
Mkfontdir
  
After the contents in the font Directory change, run the preceding command again. Next, edit your xfs font setting file/etc/X11/fs/config and add your TrueType font to your font table:
  
Catalogue =/usr/X11R6/lib/X11/fonts/misc: unscaled,
/Usr/X11R6/lib/X11/fonts/100 dpi: unscaled,
/Usr/X11R6/lib/X11/fonts/75 dpi: unscaled,
/Usr/X11R6/lib/X11/fonts/misc,
/Usr/X11R6/lib/X11/fonts/Type1,
/Usr/X11R6/lib/X11/fonts/Speedo,
/Usr/share/fonts/default/Type1,
/Usr/share/fonts/ttfonts,
/Usr/X11R6/lib/X11/fonts/100 dpi,
/Usr/X11R6/lib/X11/fonts/75 dpi
  
Alternatively, you can use the 'chkfontpath -- add' command to add the font. When used, you may also want to change the default number of points in your font.
  
Default-point-size = 140
  
This changes from the default 12-point to 14-point. Some X applications use this, while others do not. Next, make sure that the FontPath in your XF86Config file is
  
FontPath "unix/:-1"
  
Note that "unix/: 7100" can also be used, but it cannot be used when it comes out. Use '#' to convert all fontpaths into annotations. You don't need them anymore. The packages of xfs should be installed with other XFree packages. You can use 'ntsysv' or
  
Chkconfig -- add xfs
  
Now, xfs is started every time you start the system. Now restart X to read the new FontPath. Start/restart xfs in the following method
  
/Etc/rc. d/init. d/xfs restart
  
Now you should have a ready font server. You can check the fonts used
  
Xlsfonts | less
  
Or use xfontsel or even better gfontsel to check them.
  
   5. KDE
During this period, KDE was one of the best things in Linux and X. It provides a consistent user interface that allows the general public to access Linux. You can find more detailed data in http://www.kde.org. Why can I praise it a lot here? This is because the KDE 1.1
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.