Article Title: Use the TrueType font solution in Red Hat 6.0. 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.
First, I declare that I am not an expert in this field; I have no idea about the differences between PostScript and TrueType fonts. now I don't even want to know. All I want is something to work. I have to worry a lot about those details. But when I knew that these details were important to the success of a process or project, my views immediately changed.
Start...
After following the documents in kegel.com, I couldn't see the differences between my font in Netscape (4.61) and StarOffice 5.1. "Why ?" I think. After a lot of time and endless cursing, I finally decided to turn to RTFM. But it is useless. If you already know how xfs works, the xfs manual page is good, but it doesn't tell you where the configuration file is (tip:/etc/X11/fs/config ).
My first problem is that chkfontpath (8) does add the new font path to the xfs configuration file, but if your machine is configured to use the direct path to your font directory, it does not modify anything. This is what happened to me.
Modify your FontPath so that it uses xfs -- the first part
The first thing I want to do is to let X talk to my font server. Although my RedHat is configured to be automatically started by xfs, my X does not seem to talk to it. In fact, I use lsof (8) to find out which port xfs is listening to, and no port is listening to it. This may show my ignorance of xfs. The xfs startup line in my/etc/rc. d/init. d/xfs is like this:
Daemon -- check xfs su xfs-c \ "xfs-port-1 \"-s/bin/sh
The xfs manual page describes the port option that the xfs server listens. Port "-1" does not seem to sound correct. maybe it is an abbreviation of what I am not familiar with (please correct it and be polite). Therefore, I set the port of xfs to standard port 7100:
Daemon -- check xfs su xfs-c \ "xfs-port-1 \"-s/bin/sh)
Then I restarted xfs with root (/etc/rc. d/init. d/xfs restart ). Great-xfs runs as I wish, but why isn't my font look better after I restart X and log on?
Let X talk to the xfs server
It seems that although my xfs is very happy to serve, my X server does not listen to it. I have an IBM Thinkpad 760e that knows the pain of configuring X. Therefore, I saved a copy of my XF86Config file, instead of trying to guess a new configuration every time (although the capability of Linux Mandrake gives me a deep image ). My old XF86Config file does not reference any conversations with the xfs server and I have to edit it manually. This may or may not be useful to you, but it is still useful to me.
This is the old section before editing:
Section "Files"
RgbPath "/usr/X11R6/lib/X11/rgb"
FontPath "/usr/X11R6/lib/X11/fonts/misc /"
FontPath "/usr/X11R6/lib/X11/fonts/75 dpi/: unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/100 dpi/: unscaled"
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 "/usr/X11R6/lib/X11/fonts/cyrillic /"
FontPath "/usr/local/lib/X11/fonts/Type1 /"
EndSection
I simply added a reference to the font server to this file and did not find the font in the local directory:
Section "Files"
RgbPath "/usr/X11R6/lib/X11/rgb"
FontPath "tcp/localhost: 7100"
EndSection
It's much simpler, right? However, it turns out that there is more than one thing to change.
The final straw
I have a lot of fonts, but many seem redundant. I will delete them one day. My problem is that the X font server will list the paths in the order listed in the xfs configuration file. If I specify a font for a specific model (a particle font from a particle foundry), this is fine, but I just want the "Helvetica" font, it will give me a first found "Helvetica" font -- and I want it to find the TrueType font first.
When I use chkfontpat to add a Windows font path, I simply add the new directory to the end of the font path table. The result is the opposite of what I expected.
# Searching for fonts
# Some have been commented out, such as the TrueType and Type1 directories in/usr/share, because they do not have to be installed together with X.
#
Catalogue =/usr/X11R6/lib/X11/fonts/misc,
/Usr/X11R6/lib/X11/fonts/75 dpi,
/Usr/X11R6/lib/X11/fonts/100 dpi,
/Usr/X11R6/lib/X11/fonts/Type1,
/Usr/X11R6/lib/X11/fonts/Speedo,
/Usr/local/lib/X11/fonts/Type1,
/Usr/X11R6/lib/X11/fonts/misc: unscaled,
/Usr/X11R6/lib/X11/fonts/100 dpi: unscaled,
/Usr/X11R6/lib/X11/fonts/75 dpi: unscaled,
/Dos/windows/fonts
So, in order to get the desired result, I simply modified the font order:
# Searching for fonts
# Some have been commented out, such as the TrueType and Type1 directories in/usr/share, because they are not forcibly installed with X.
#
Catalogue =/dos/windows/fonts,
/Usr/X11R6/lib/X11/fonts/misc,
/Usr/X11R6/lib/X11/fonts/75 dpi,
/Usr/X11R6/lib/X11/fonts/100 dpi,
/Usr/X11R6/lib/X11/fonts/Type1,
/Usr/X11R6/lib/X11/fonts/Speedo,
/Usr/local/lib/X11/fonts/Type1,
/Usr/X11R6/lib/X11/fonts/misc: unscaled,
/Usr/X11R6/lib/X11/fonts/100 dpi: unscaled,
/Usr/X11R6/lib/X11/fonts/75 dpi: unscaled
Finally succeeded.
Dramatic Results
The results are good for us who see all of this.
This is part of the StarOffice2 file. There are two rows: the first line uses the TrueType "Times New Roman" font, and the second line uses a non-TrueType "Times" font.
1. note: some people do not pay for software, but my other partition does have a legal copy of Windows. I try to pay for all my software, even if it comes from Microsoft. Fair is fair-I only want value for money.
2. This article is all written in StarOffice 5.1-honestly not bad. There are too many useless tags in HTML, but I 'd like to try it. I usually use Emacs in Viper mode.
References:
Make StarOffice fonts in GNU/Linux better.
By Zubin D. Dittia (zubin@growthnetworks.com)
I recently downloaded StarOffice from Sun's Web page (http://www.sun.com/staroffice/) and successfully installed it on my RedHat 6.0. This Office looks really beautiful. its demo tool is even better than Microsoft Office's Powerpoint, but the font looks dirty and ugly, making people uncomfortable.
Obviously, XFree86 does not currently support TrueType fonts. I know that the TrueType font stores the font description rather than the bitmap in a curve, so it can be scaled up and down. In future versions of X, TrueType fonts will be supported, but the fire cannot be solved.
I found at least one Web page very helpful in fixing this issue: http://www.mindspring.net /~ John_mcl/adding_fonts.html by John Mclaughlin (johnmcl@mailexcite.com ). Although I had a problem following the steps described, I finally made the font work right after some effort. This section describes my steps. Note that I have only tested it in red hat 6.0 and may make some modifications in other versions of GNU/Linux.
Dan Kegel later cited me to his Web page (http://www.kegel.com/linux/tt.html), where there was a simpler way to make the font work correctly under RedHat 6.0.
Later, I heard Aaron Bredon say that at least the red hat distributions already include support for TrueType fonts, so you can replace the following 3rd ~ Step 13: just edit the file/etc/X11/fs/config, add the TrueType font directory, and then run/etc/rc. d/init. d/xfs restart.
I have never tried this method, but I hope you can try it. I can't go back to the lengthy steps below.
You have to try your best to get several different source code releases from many places. for simplicity, I have packaged the latest versions of various packages (99.9.4). you can download them: http://king.ccrc.wustl.edu /~ Zubin/fontstuff. tgz. Downloading will save you, but I have no plans to update it constantly. if you want the latest and strongest versions of each package, you have to download it at the address mentioned below.
Step 1
$ Cd/usr/X11R6/lib/X11/fonts
$ Mkdir tt_fonts
$ Cd tt_fonts
$ Cp/dos/windows/fonts/*. ttf.
(Replace/dos with the partition where your Windows directory is located, for example,/mnt/dos)
Note: Unfortunately, you cannot get a set of TrueType fonts for free. I can only assume that you can get the font for MS Windows. we will use it later. If you do not have Windows, you can get some free MS fonts from their web pages: http://www.microsoft.com/typography/fontpack/default.htm. You can also find other good TrueType fonts from other places on the web. go to this URL to see the free fonts web address list: http://www.dcs.ed.ac.uk/home/jec/programs/xfsft/fonts.html.
Step 2
Get ttfmkdir (http://www.darmstadt.gmd.de /~ Pommnitz/xfsft.html), and run it in the tt_fonts directory. A Red Hat Linux/usr/sbin has been installed, so we don't need to do it.
$/Usr/sbin/ttmkfdir> fonts. dir
You can ignore any error messages, or, if you want, delete all the font files that cause the error and re-run ttfmkdir.
Step 3
From http://quadrant.netspace.net.au/ttf2pt1/to ttf2pt1. What version do I use in the file ttf2pt1-311.tgz?
$ Cd/usr/local/src
$ Tar xvfz ttf2pt1-311.tgz
$ Ttf2pt1-311 cd
Edit The Makefile in the directory and comment out the two lines to be commented out. Run make:
$ Make
Generate three binary files: t1asm, ttf2pfa, and ttf2pt1
Step 4
Slave.
$ Cd/usr/local/src
$ Tar xvfz ttfutils-0.1.tar.gz
Step 5
Run the following command:
$ Setenv PATH ${PATH}:/usr/local/src/ttf2pt1-311
$ Setenv PATH
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.