Article Title: serialization: Linux font setting method. 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.
This time we will explain how to adjust all kinds of font settings, how to install new fonts, and other methods that can greatly improve the appearance and readability of Xwindow fonts. This is by adjusting the FontPath in the XF86Config file, adding the Xserver command line options to startx or xdm, and installing the TrueType font server) xfs, and use the K Desktop Environment 1.1 feature to adjust the font settings of many applications, including settings so that the colors and fonts of non-KDE applications can be consistent with KDE.
XF86Config File To solve the font problem, you must first check the XF86Config file. (Usually in/etc/X11/XF86Config ). The most important part of this file is FontPath. Before we study it, we 'd better check other settings of X first. Wrong Screen Settings are more headaches than wrong font settings. Determine the update frequency (refresh rate) of your screen ).
Set FontPath Use the vi text editor to edit XF86Config. At the beginning of the file, you should see something similar to the following:
FontPath "unix/: 7100"
FontPath "/usr/X11R6/lib/X11/fonts/TrueType"
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 fonts used for display on the screen. Sequence is very 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 to see the fonts that meet the requirements of X client.
The default FontPath usually places the 75 DPI font in front of the 100dpi font. If there is a high-resolution screen, this indicates very small words. First, deploy the 75 DPI and 100dpi FontPath.
FontPath "/usr/X11R6/lib/X11/fonts/misc /"
FontPath "/usr/X11R6/lib/X11/fonts/Type1 /"
FontPath "/usr/X11R6/lib/X11/fonts/100 dpi /"
FontPath "/usr/X11R6/lib/X11/fonts/75 dpi /"
Then point out the preference to use unscalable dot matrix words. If you have used Netscape or other programs that use a large font to display titles, you will find these fonts are jagged. This is ugly and needs to be modified. Therefore, unscaled is added at the end of misc, 100dpi, and 75dpi. 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 at the front, telling X that if possible, try to use words that cannot be scaled.
X server command column options The following is how to adjust the command column options of X server. You can use-dpi to specify the resolution of each inch. Many systems now use high-resolution displays, and may use 100 dpi.
Start X on the console, and type
Startx-dpi 100
If you use the xdm image to log on to the interface, you need to edit the/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
TrueType Added support for TrueType fonts in Windows. Both Windows 95 and other Windows systems include Arial, Times New Roman, and Courier New. It is equal to Helvetica, Times, and Courier. TrueType fonts can be scaled, so they are nice to see when zoomed in, and they are well adjusted, so they are still readable when zoomed out.
Xfs Xfs is a type of font server. XteamLinux 4.0 uses this font server by default. Xfs is based on FreeType Font library. It can not only handle TrueType and Type 1 fonts, but also the original X fonts.
Installation The first step is to add the TrueType font to Xteamlinux 4.0. 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 cp/mnt/win/path_to_fonts/* ttfusr/share/fonts/ttfonts/from Windows or download it directly from Microsoft.
These fonts are self-decompressed ZIP files. You can also install it as follows:
Unzip Note that the font name file 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 is to first enter the directory where the fonts are stored, and then type:
Ls * TTF | while read f
Do
[-F ""] & mv-f "'echo" "| tr A-Z a-Z '"
Done
Pay attention to punctuation marks-those "backquotes" are important. After the TrueType font is correctly installed, run the following command as a superuser:
Ttmkfdir-o fonts. scale
Mkfontdir When 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 the 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
You can also use the "chkfontpath -- add" command to add fonts. Use the following method to change the default number of font characters.
Default-point-size = 140
This changed from the preset 12-point to 14-point. Some X applications use this, while others do not. Next, make sure that the FontPath in the 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. To determine whether the service is a preset service, you can use "ntsysv" or "chkconfig -- add xfs ".
Now, xfs is started every time you start the system. Restart X to read the new FontPath. Start/restart xfs in the following way
/Etc/rc. d/init. d/xfs restart
In this way, Xteamlinux 4.0 has a ready-to-use font server, and it has been started to check which fonts are being used:
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.