April 26, 2019

.comment: A Whole New Desktop with Anti-Aliasing - page 2

A Really Polished Look for Linux

  • March 14, 2001
  • By Dennis E. Powell

Let me say right off the bat that if your hardware is supported, as mine is, enabling screen font anti-aliasing is incredibly simple. I need to provide this anti-caveat because it was anything but simple for the four days I spent trying to get it to work here, which story I tell because otherwise the four days will have been entirely wasted, because it gives me the opportunity to thank some people who time after time go the extra mile to help users resolve problems, and because it is illustrative of the fact that software problems arise sometimes from completely unexpected places.

When a hacked QT-2.2.3 that Keith Packard had put together was made available a couple of months ago, I took it for a spin. It was pretty enough, but my typeface selection dialogs had all become empty. My desktop comprised a sans serif proportional typeface, and a nondescript fixed one, and those were the choices. Others reported no problems. After hammering away at it for awhile, I decided that perhaps I was expecting too much. Meanwhile, the typefaces were not especially objectionable even if they would not have been my first choice, and anti-aliasing gave KDE such a delightfully polished appearance that I decided I'd live with them -- after all, this was just a hack, and one does have to expect certain inconveniences when dealing with software so developmental that the official KDE stance was that it would countenance no bug reports connected with anti-aliasing.

So when QT-2.3.0 came out, and it was now official, I figured it would probably work just fine, and whatever gremlin had denied me my full range of typefaces had probably now been banished. I was wrong.

I built the new QT. I fired up KDE. Same problem as before. Okay, I rebuilt KDE against the new QT. Shouldn't have been necessary, and as it turns out isn't (though there's one little advantage to doing so, which I'll get to). No joy. Recompiled the very newest XFree86 as reflected in that day's CVS tree. Nope. (By the way, doing so just about doubled the speed of the video here. It could be something specific to my video card, but if it's more general, XFree86-4.03 is going to be an enormous improvement.)

Desperate, I gave in: I read the docs. The XFree documentation is a little odd. First, the good stuff lives off in the boonies: /usr/X11R6/lib/X11/doc. Second, there is one README[something].txt for every computer sold since the Altair. Third, the nearby HTML version contains none of the good stuff, which is in those text files. The fonts textfile seemed appropriate, so I consulted it. It said that I should set up the XFree font manager, xfs, which I did. (For purposes of brevity rather than to hide my stupidity, I'll leave out here how I set it up at one point such that my machine booted, launched xfs, and stopped there, and my panicked late-night phone call to Kurt Wall, who a.) wrote much of the Caldera eDesktop documentation and who b.) is in the phone book and is a friend and who c.) talked me through the fix.) Xfs was not the answer, even when the machine booted all the way to a prompt.

I annoyed the good people on the KDE development and XFree86 mailing lists, and got lots of encouraging help. Malte Straostik from the KDE developers list stayed up very late Thursday night (I know it was late, because it was late here and he's in Germany) offering suggestions, code, and moral support in a series of rapid-fire emails. Lars Knoll of TrollTech offered help and even a HOW-TO that he put together (possibly partially in hope of shutting me up). Keith Packard explained the workings of the Xft configuration file, which at some point I had concluded (incorrectly) was the culprit. The community again proved that it is tremendously helpful if it thinks you're really trying, even if it also thinks you've maybe gone crazy because stuff that works everyplace else is not, you say, working for you.

Late Friday, day three of my anguish, Matt Newell posted to the KDE developers list that there was a bug somewhere that caused KDE fonts not to be listed for him. He posted a patch to kdelibs that would fix it. I applied the patch and prepared to do a recompile, not at all certain that this had anything to do with the problem I was seeing. It was a very small change -- an edit rather than a patch per se -- and I, not a coder, did not see its significance. And having had at this with the frenzy that is experienced only by a computer user determined to make something work that doesn't want to, I was exhausted, and went to sleep.

Saturday morning, there was a note from David Faure. If I knew him, he'd be the brightest guy I know. My impression is that he knows the KDE code the way Linus knows the kernel, and that somewhere in his head he's established a virtual computer that ticks through code. But more than that, he can explain it! He now took note of Matt's discovery and said that the line in question apparently pointed to a ~/.kde/share/config/kdefonts file, an artifact from the kfontmanager that is no longer a part of KDE2. It limited the typefaces available to KDE, none of which was useful to the Xft extension.

Because I have built KDE2 from the CVS tree every week or two for a year and a half, and because going around and reconfiguring everything is not much fun, I only made a habit of keeping my ~/.kde directory from build to build. When kfontmanager dropped off the screen, its configuration file remained. I found kdefonts and changed its name to oldbadkdefonts and restarted KDE. Here's my response to David's email:

"BINGO!!!! BINGO!!!! give the man a cigar! renaming this file, which appeared last june 15, solved *all* the a-a problems here!"

David responded that the discovery had actually been Matt's and also that he, David, does not like cigars.

So, I'd had about 85 hours of struggling with this problem, 84 hours, 59 minutes, and 45 seconds of which were wasted -- if I'd nuked that file, anti-aliasing would have worked from the beginning. I did not suspect that file. Hell, I didn't know I had that file. And I'd all but forgotten that I'd once had a kfontmanager.

Actually, it wasn't a waste. I learned a lot, both about the workings of typefaces in XFree86 and about the brilliance and friendliness of the community.

You have endured my tale of woe and, I hope, taken the acknowledgments seriously. Now let's move on to how you can make this thing work, including the 95 percent obvious stuff that anybody can figure out in five minutes and the 5 percent that got dribbled out over the rest of the time I was scrambling around.

Most Popular LinuxPlanet Stories