Newsgroups: comp.os.linux.x
Newsgroups: comp.os.linux.x
> I want to know how to make X display anti-aliased fonts on screen. This > would be something like the "Smooth edges of screen fonts" option in
You might or might not be able to do this, depending on your video card, version of X, and apps. There's a pretty good description of how to pretty up your fonts at
Steve Martin
Read the whole thing.
Hal B
Newsgroups: linux.redhat.install Date: 2002-10-26 09:34:24 PST
>I think fonts on some websides could be better (especially the smallest >fonts don't seem very smooth) compared to Microsoft IE .
There is an excellent article on The Register, which gives instructions on how to install decent fonts (Assuming you are on Redhat 7.3 and use KDE - although they will probably work for other environments with a few minor tweaks)
The article is at http://www.theregister.co.uk/content/4/27788.html
Mat.
By Thomas C Greene in Washington Posted: 25/10/2002 at 11:35 GMT
One of the more common disappointments reported about the Linux GUI is clunky fonts under X. While it's true that they can look pretty rough out of the box, it's also true that sharpening them up is easy and well worth the effort, thanks to MS TrueType fonts and the open-source FreeType project which makes them useable on Linux. What follows is an explanation of how to tweak them, assuming KDE is your desktop manager. (I imagine this may work on other desktops, but KDE is the only one I'm well acquainted with.)
The first step is to download and install the MS TrueType core fonts. These used to be available from MS but are no longer, though they can be had now courtesy of SourceForge here, along with detailed instructions for downloading and installing them. You'll have to download a source RPM and then build a binary RPM. If you're a newbie and this sounds intimidating, there's a simpler alternative if you have an existing Windows image on your Linux machine: simply copy the desired fonts from the Windows partition to a directory on your Linux partition. My guess is that if you've paid MS for the privilege of using their fonts, you can use them with another OS so long as you don't distribute them without permission.
Now, merely having TTFs or anti-aliasing isn't enough. Take a look at this screen shot of TTFs in an OpenOffice.org document. They're clunky and blocky and basically impossible to distinguish from each other. However, with a bit of tweaking we can make them look distinct, slick and refined, as you can see in this screen shot. http://theregister.co.uk/media/929.png http://theregister.co.uk/media/930.png
The difference between the two is a feature in FreeType which is turned off by default. You may have anti-aliasing selected via the KDE Control Center, but unless you build the FreeType font engine with a trick I'm going to explain, this setting has little or no beneficial effect on TrueType fonts.
Due to licensing hassles, FreeType is distributed with some TTF support switched off. Thus we have to build FreeType so that this feature is available, a procedure which, fortunately, is quite easy. That's the only difference in the two screenies above — the first was shot with FreeType in its default configuration, the second with FreeType tweaked in the manner that I'm about to describe.
First you need to download the FreeType source tarball and unpack it in a convenient directory, probably /root since some of what we have to do needs to be done as root anyway. Once it's unpacked you need to edit a file in the FreeType directory: go to freetype-2.x.x/include/freetype/config/ftoption.h and open it in a text editor. Now find the line in ftoption.h which reads
#undef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
and change it to
#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER.
Save your change.
Now bust out a shell and find out where FT should be installed with the command freetype-config —prefix. This will tell you where it's installed on your system, if you have it installed. Install the new version in the same directory with the prefix command. For example, assuming it's in /usr/local, you would start with the command ./configure —prefix=/usr/local and so on. If you don't have FT installed, it defaults to /usr which is fine. Now just run ./configure —yourprefix, then make, then make install and you're almost home.
There's a little issue with XF86 version 4 which makes it prudent to do the installation again in /usr/X11R6, following the steps above. When you upgrade FT, you'll have to install in both directories again.
All right, now you have your TTFs copied and your FreeType engine installed. Now it's time to make them available. Re-start X, and then open the KDE Control Center as root. Go to System, Font Installer. Click the tab 'Anti-Alias' and tick 'Use sub-pixel hinting'. Now click the 'Fonts' tab. On the left you'll find a tree designating the directory to install the TrueType fonts from. Select whatever directory you copied them into originally. On the right you'll find a tree designating the directory to install the fonts to, typically /usr/X11R6/lib/X11/fonts/truetype. Set the directories and then select all the TrueType fonts in the source directory and click on 'Install'. In a moment they should all show up in the destination directory. Now click 'Apply' and OK on any error messages you might get.
That's all there is to it. Re-start X again, and all your apps should be able to exploit the new fonts, except OpenOffice.org, which needs an extra step. You can open Krusader or Konqueror or Mozilla and in the fonts sections find the TTFs to be applied according to your choice. You can apply them to the KDE desktop with Control Center, Look & Feel, Fonts (make sure 'use anti-aliasing' is ticked), and Control Center, Look & Feel, Desktop. You can apply them to Kedit and Kmail and a score of other apps.
For OpenOffice.org you need to install the fonts again manually. Go to your OO.o directory and execute the file, spadmin. Go to Fonts, Add, and choose the source directory, /usr/X11R6/lib/X11/fonts/truetype. When the fonts are visible in the window, click on 'Select All' and then 'OK'. You'll then be given a choice of copying the fonts to your OO.o directory or linking to them. Either will work.
All right; you've done it. Below are screen shots illustrating how handsome KDE can be with TrueType fonts properly supported and configured. This is what I'm looking at; there's no reason why you shouldn't be too.
KDE Control Krusader Mozilla1 Mozilla2
Note, several readers have pointed out that this technique seems to break anti-aliasing. It does, but not universally. Some fonts will have it and some won't. However, merely disabling anti-aliasing definitely doesn't work as well as enabling the bytecode interpreter. Regardless of the side-effects, the result is a KDE desktop that's easy to look at, imho. —tcg
Caveats
Reader Simon Burns reports that installing FreeType from source on Red Hat 8 made his KDE desktop disappear. He fixed it by deleting libfreetype* from /usr/X11R6/lib and /usr/lib and installing the Red Hat FT RPMs.
Reader Adam Williamson believes that Mandrake users should avoid building the FT package from source. He says, "Mandrake users should not rebuild FreeType; they should simply use the FreeType RPMs from PLF - the Penguin Liberation Front - which are stock Mandrake RPMs, but rebuilt with the bytecode interpreter enabled. If you run Mandrake 9.0, the appropriate RPM is at: http://plf.wwwhost.biz/files/9.0/i586/freetype2-2.0.9-3plf.i586.rpm"
If you once configured TrueType fonts correct under Linux, you've gotten used to crisp clear smooth fonts. But with RedHat8 came Xft2 - with the possability for anti-aliasing (AA) set as default. Sorry to say, but IMO, both AA and non-AA fonts under Xft2 look like crap. Even the far superior cleartype technology used on MS Windows looks a little blurred to me so I never used it there either.
In order to get non-aliased fonts without the Xft2 hinting making the fonts look like barbed wired:
In KDE: Run qtconfig and disable antialiased font rendering in it for QT. In GTK/Gnome: Add "export GDK_USE_XFT=0" to .bashrc Personally i don't load the "freetype" or "type1" module in XF86Config, but instead use xfs. Then add the truetype fonts you have to a local ~/.fonts directory and while there, run "fc-cache"
(Or else (basically) KDE/Qt or Gnome/GTK doesn't "see" your TT fonts)
Make sure you don't have any funny font-rendering code added in your After a restart all my TT fonts looked like I prefer them; crisp clear and smooth. I've enjoyed TT fonts on RH for the past 4 years and am very pleased with the quality - now also in RH8 :)
If you can't get it going and things look like shit: Compare to this screenshot (COMING) for how things should look. Do NOT believe people who say you should recompile the freetype library in order to make this look good - they are false prophets!