Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
X GUI

Xft Hack Improves Antialiased Font Rendering 360

Eugenia writes: "Font antialiasing first made its way to XFree through Qt/KDE only a year ago and GTK+/Gnome followed some time after. Even with the latest version of Freetype 2.08, which reportedly brings better quality, the result is still not up to par with the rendering quality found on some commercial OSes. David Chester has hacked through the Xft library and he achieved an incredibly good quality on antialias rendering under XFree86. With this hack, at last, XFree can deliver similar aesthetic results to Mac OS X's or Windows' rendering engines. Check the two brand-new screenshots ('before' and 'after') at his web page and notice the difference with your own eyes."
This discussion has been archived. No new comments can be posted.

Xft Hack Improves Antialiased Font Rendering

Comments Filter:
  • by BJH ( 11355 ) on Wednesday March 06, 2002 @03:04AM (#3116912)
    Unfortunately, there's a BIT of a DIFFERENCE between rendering for overlay ON video (which means you can take AS long AS you like), and DOING anti-aliasing for a semi-REAL-time user INTERfAcE.

  • by Anonymous Coward on Wednesday March 06, 2002 @03:14AM (#3116937)
    The site says:


    Again, please note that my changes consisted only of two lines of code worth of changes: setting some flags in freetype glyph structs, and adjusting the rendering resolution. Any praise should generally be directed to the folks at freetype and the author of Xft and XRender, Keith Packard.



    How does changing two lines of code merit a frontpage story on slashdot?
  • by foqn1bo ( 519064 ) on Wednesday March 06, 2002 @03:42AM (#3116969)


    Did YOU ever do anything so simple who's outcome was so useful? No, of course not. Otherwise you wouldn't be so damn pissed about it. Two lines of code it may be, but the results are what got people talking about it, and in the end that's all that matters. Except to people like you, of course.

  • by spectecjr ( 31235 ) on Wednesday March 06, 2002 @03:58AM (#3117002) Homepage
    Check out this article [grc.com]. ClearType is just Microsoft's name for sub-pixel rendering, and it's been around for decades now.

    Yeah, but Gibson is also an ass who doesn't seem to know the difference between scientific method and guesswork.

    MS research [microsoft.com] has the fully detailed papers which indicate the fourier transforms, information theory and signal processing theory behind the technique. Which is a damn sight more thorough than Gibson's quackery.

    "Oh yeah, apple did it all in the 70s". Bullshit. Back then, the Apple II didn't have the hardware or the CPU power to do the kind of calculation you need to do for Cleartype. Nor did it have the color resolution. All Apple's tech was was a way of hacking color out of a monochrome NTSC signal -- not getting better resolution out of a monochrome signal using color. Get the difference?

    When are people around here going to do some thinking and some research instead of acting like idiots? I thought that people who flock to sites like this were supposed to be tech savvy? Maybe it's just me, but I thought that indicated at least a modicum of intelligence instead of blind sheepery.

    Simon
  • by koekepeer ( 197127 ) on Wednesday March 06, 2002 @03:58AM (#3117003)
    it might just be a typical "ignorance is bliss" situation on my side, but if this effect was largely achieved by disabling the (apparently buggy) hinting support in freetype, why did they enable it in the first place?

    i'm not trying to insult the freetype guys, they've done great work to make X look nicer, but this hack would probably not exist if they would have disabled hinting by default.

    the screenshots do look okay, but are still somewhat blurry. i actually prefer not using antialiasing below 10pt anyway, the fonts quickly become unreadable. but that IMHO of course.
  • by mike_sucks ( 55259 ) on Wednesday March 06, 2002 @03:59AM (#3117006) Homepage
    Doesn't it scare you that something as fundamental as screen rendering algorithms can be changed using a *checkbox on a page from a remote website*?

    My god, no wonder new exploits are constantly being found in Windows and IE.

    Mike.

    (-1, Offtopic)

  • Re:ClearType? (Score:1, Insightful)

    by bonch ( 38532 ) on Wednesday March 06, 2002 @04:03AM (#3117010)
    Hmm, I have Windows XP using ClearType, and I'm using a CRT. Everything is nice and smooth, even tiny fonts.
  • AA text fuzzy? (Score:4, Insightful)

    by rubinson ( 207525 ) <rubinson @ e m a i l.arizona.edu> on Wednesday March 06, 2002 @04:08AM (#3117020) Homepage
    I'm really not trying to troll here but anti-aliased text has always looked fuzzy to me. In the screen shots, for example, the spacing and sizing of the AA text is certainly nicer but the default text seems shaper and crisper. Am I wrong here? Joel Spolsky agrees with me [joelonsoftware.com] but everyone else seems so excited about AA text that I have to wonder if I'm missing something.
  • by lightspawn ( 155347 ) on Wednesday March 06, 2002 @04:12AM (#3117030) Homepage
    Sure it's possible - for you. But here's a newsflash - most people, (who, by the way, know a lot more about their industries than you) don't know enough about X to configure it. And most don't have either the time or the inclination to learn.

    So how the OS is shipped determins how good the fonts look for most people. If you can make it look better, make that the default.

    The goals of "making everybody see the light and switch to Linux, thus toppling micro$oft" and "forcing every Linux user to spend hundreds of hours learning about the system" are MUTUALLY EXCLUSIVE.
  • by markj02 ( 544487 ) on Wednesday March 06, 2002 @04:19AM (#3117051)
    Computer text is usually rendered onto a solid color and displayed on a high-quality, high-bandwidth device. That has almost nothing to do with rendering text for overlay onto a pictorial background and display on a low-pass, noisy device like broadcast television. Rendering text for GUIs the way you render it for television would be like slapping people in the face to get their attention and just would drive them crazy.

    Anti-aliasing for computer displays is overrated anyway. Whether it helps or hurts readability depends on the font and font size, and on high resolution displays it is pointless. Printed matter isn't anti-aliased either, and printed matter is the gold standard for good looking text.

    So, if you want text that looks nice, get yourself a 150dpi or higher monitor and don't bother with anti-aliasing. Anything else is a kludge.

  • by colmore ( 56499 ) on Wednesday March 06, 2002 @04:23AM (#3117058) Journal
    This really isn't meant to be a flame.

    This seems to me to be a technology of limited use. Even at high screen resolutions almost all text is rendered at 12 pt, at which size anti-aliasing is more or less worthless.

    It makes title bars look pretty. It makes big text on web pages look pretty. But for 99% of the text you see, it doesn't do much.

    I don't want to discount the effort. I mean, if this program is as good as the screenshots suggest, then excellent job. (I haven't been able to test it out myself yet)

    I guess I'm just not used to the modern computing era when it really is possible to throw in everything and the kitchen sink. I've gotta keep reminding myself that if something takes up an extra meg of Ram/swap and thirty megs of drivespace, that really doesn't matter. All of my instincts are still roughly in the 486 era, and I still think "why?" at every feature.

    I just think at this point, the opensource community needs to give up its right to accuse others of bloatware. Bloatware is the modern standard, and if we don't embrace it, we look feature-poor. But Linux in the form that nearly everyone sees it and uses it today is bloatware. Well designed bloatware, for the most part, but bloatware nontheless.
  • by Johan Veenstra ( 61679 ) on Wednesday March 06, 2002 @05:48AM (#3117188)
    This guy just disabled hinting and adjusted the rendering resolution to his liking.

    Without hinting, fonts will never look as good as they do on MS Windows or OS X.

    Messing with the rendering resolution to make certain fonts look a little bit better seems to be the kind of hacking a chicken without a head could do.

    This is not the ueberhack slashdot makes it out to be. This is not news.

    regards,

    Johan V.
  • by jacrawf ( 691 ) on Wednesday March 06, 2002 @05:51AM (#3117198)
    Bzzzt. Printing is analog, it's naturally anti-aliased.

    Uh, actually virtually all CRTs are analog too. (Old CGA displays don't really matter much these days, though...) Or did you think the signal coming out of that 15-pin d-sub VGA connector was digital? Surprise, it isn't. Not to mention that some of the electrons meant to bombard phosphorescent element n tends to go astray a bit and bleed into adjascent phosphorescent elements. The results of this can be seen quite dramatically on low-quality CRTs at high resolutions.

    In other words, paper is really no less digital than a CRT is. Just as a 640x480 image looks kinda blocky taking up your whole CRT, it looks just as blocky taking up a whole sheet of paper. It's paper's virtue of being able to handle insanely high resolutions that makes it suitable for "displaying" really clear graphics and text. I can't think of a single reason that a CRT oughtn't be able to do the same one day. Anti-aliasing is simply a stop-gap technology until that day arrives, IMHO.

    Personally, if I had the option, I'd go for a 150 DPI (or better, actually 300 DPI would make me happy) display over something that only does, say, 1280x1024 with antialiasing. I'd much rather talk about picas and points than pixels. Pixels suck; they're the cause of too much geek envy. (Admit it! When you were still stuck with an 800x600 display you were drooling when your rich friend upgraded to a 20" display that could do a whopping 1600x1200.)

  • by markj02 ( 544487 ) on Wednesday March 06, 2002 @05:58AM (#3117220)
    Bzzzt. Printing is analog, it's naturally anti-aliased.

    Well, maybe that's what they tell the arts majors. However, the term "aliasing" actually refers to what happens when you try to exceed the Nyquist limit: different frequencies are "aliased" together. Anti-aliasing removes that by band-limiting the signal in some way prior to sampling. When you print with toner on paper, there is nothing band-limited about the resulting image: the toner/paper transition has very high contrast edges at just about any resolution you care to look and those result in very high frequency components in the image.

    the fact the the text doesn't look butt-ugly as usual.

    You demonstrate a common occupational hazard for people working in graphics: you prefer style over function.

    Think about anti-aliased text on a 150 dpi monitor.

    For most monitors, you wouldn't even be able to tell the difference. And for a high-resolution monitor designed to display text, you make the display worse if you try to anti-alias.

    Usually. What about when it isn't?

    If you composite onto an image, the text needs to undergo the same filtering as the the image has undergone or it will look unnatural. In the case of compositing text into television images, there happens to be a single answer because, by convention, television cameras try to degrade the image in roughly the same traditional way. For digital images you find on computers, the filter could be anything.

  • by nagora ( 177841 ) on Wednesday March 06, 2002 @06:43AM (#3117319)
    My eyes tend too hurt, anyone who can explain this ? and the text looks blurred too,

    The two are related, the text looks blurred because it is, that's what AA does - it smooths (or smears) the edge of the glyphs in order to make the "jaggies" less obvious. Until you get used to it your brain can interpret this as the characters being out of focus and sends all sorts of trial adjustments to the eye to try to bring it into focus, which it can never do as the characters really look like that. Eventually your eye becomes tired from all these micro adjustments.

    If you fiddle with your XfConfig file you can tell X not to AA above or below certain sizes so you might be able to get a better effect that suits you. On the other hand, if your monitor is good enough and you only use fonts designed for screen useage just turn AA off!

    TWW

  • by kcbrown ( 7426 ) <slashdot@sysexperts.com> on Wednesday March 06, 2002 @07:34AM (#3117411)
    Look, my comment is in no way a criticism of RENDER. I can see lots of advantages to having that extension, and it's excellent work.

    What I'm talking about is fonts, and only fonts.

    Antialiased text might be an interesting and cool use of the RENDER extension, but it's not a particularly good use, and here's why:

    1. Every toolkit for which you want antialiased text must be compiled with Xft support (or whatever client-side font handler supports the RENDER extension).
    2. Every client machine on which you're running an X application must not only have the above mentioned toolkits, but must also have a set of fonts to be used by the client.
    3. You now have to concern yourself with whether or not the fonts are all the same on all of the client machines you're going to use.
    4. If you want to use a font on multiple clients, you have to install it on all of those clients, instead of simply sticking it on the font server.
    5. Since there's no guarantee that the X server supports the RENDER extension, every client (or toolkit that the client uses -- this could be included in Xft, for instance) has to have fallback code which uses the standard X font calls in case the RENDER extension is unavailable. But this is a big problem, because now you have to concern yourself with whether your font metrics (among other things) for your standard server-side fonts are the same as the ones for the fonts on the client, since the font set being used by the X server is different than the font set being used by the client.
    6. Proprietary toolkits and clients (particularly those that are statically linked) gain no benefit at all -- they use non-antialiased fonts as usual.
    7. All the world isn't Unix, you know. What are you going to do about those X clients that are running on systems on which your toolkits won't even compile (VMS comes to mind, outdated as it may be)? X isn't just supposed to be network-based, it's supposed to be platform independent, but this method of font handling is anything but.

    The end result that I see is that client side font rendering doesn't give you any real advantages over server side rendering, with the sole exception (that I can think of, at any rate) that the client will know that the font being displayed on the screen and the font being used for printing will have the same metrics and appearance. Other than that, you take a performance hit (client has to upload the font to the server every time it wants to use it, the same font will be uploaded multiple times by multiple clients or at least multiple toolkits, since it's possible for the toolkit to cache the font locally in shared memory or something. I'm making certain assumptions about the implementation here, though), you get inconsistent font handling and rendering (what says that toolkit A will use the same font set as toolkit B?), you'll probably use a lot more in the way of server resources if you're running clients on lots of different machines, and worst of all your desktop looks really inconsistent. The only time you don't really run into most of this is when the client and server are on the same machine. While I'll admit that this is most of the time, if you're going to give up some of the advantages of a networked display system why stop there?

    It seems to me that this way of handling fonts does exactly the same thing for fonts that client-side GUI toolkits does for look and feel: causes a ton of confusion, makes it difficult to get a consistent look and feel on the desktop, and causes a lot of waste in the process.

    So the bottom line is that, as far as I can see, what we really need is the RENDER extension and server-side antialiased font handling. (We also need server-side toolkits, but that's a discussion for another day).

  • by LunarOne ( 91127 ) on Wednesday March 06, 2002 @08:09AM (#3117475) Homepage
    Anyone who has maintained a large codebase, or has made mods to someone else's code, knows this:

    Sometimes hours and hours of work can result in very few lines of code. It reminds me of the carpenter's rule: "think twice, saw once". Sometimes a great deal of analysis yields more results than many lines of code.
  • by Theovon ( 109752 ) on Wednesday March 06, 2002 @11:49AM (#3118656)
    People in the XFree project may already be considering this, but antialiased objects look much better when you take into consideration that a gray ramp that is perceptually linear is not optically (luminously?) linear.

    To be specific, imagine you're drawing an antialiased line, and you have come to a point where the line covers 50% of two adjacent pixels, so you decided to paint them both with 0x7f. The problem there is that a pixel that looks like 50% gray is actually emitting 18% as much light as a full-on pixel, so when you put the two 18% pixels together, they add up to 36% instead of 100%. The result is that a thin antialiased line will appear to get darker and lighter along its length. If you were to take this into account, it might improve antialiased text further.

    The function to apply to all pixels is this, where x is a number from 0 to 255 representing the brightness you WANT to get, and y is what you have to plot:
    y = (int)(255.0 * pow(x/255.0, 1/2.5) + 0.5)

    The +0.5 rounding factor in there may not affect much.

    I believe it was a Dr. Poynton who talked at length about this in the 1998 Siggraph.

    Thanks.
  • blurry text (Score:3, Insightful)

    by Mr. Slippery ( 47854 ) <tms&infamous,net> on Wednesday March 06, 2002 @02:05PM (#3119697) Homepage
    With this hack, at last, XFree can deliver similar aesthetic results to Mac OS X's or Windows' rendering engines.

    Ah, so blurry text is an "aesthetic result"?

    "Anti-aliasing" just means blurring [joelonsoftware.com], and is in general not a good thing. And this particular hack turns off hinting, to make it every blurrier.

    Like headaches? Install this.

  • by Anonymous Coward on Wednesday March 06, 2002 @06:22PM (#3121459)
    I completely agree.

    The fact that so many people have gone so crazy over ClearType (a half-assed, ugly hack to squeeze in more pixels *only* in the horizontal direction) is a pretty good indication that people want more resolution in their displays.

    Two things need to happen. One, more stuff needs to be resolution-independent. Right now, if you jack up the res on most Windows users' systems, they complain that things are "too small". Setting the size and the res on something should be different operations. Seriously.

    Second, we need to get those high-res monitors out!

    How much more would you pay for a monitor with 150 or 200 dpi?
  • by Performer Guy ( 69820 ) on Wednesday March 06, 2002 @11:22PM (#3122739)
    This is great stuff, well done. It is also a perfect illustration of the dangers of using a misunderstood technology; hinting. Hinting was originally designed to help non antialiased fonts shift character vectors to align with discrete pixels for a more recognizable character description. It's application to antialiased fonts was foolish and never worked because the antialiasing is perfect for displaying the subpixel hint shifts being applied and makes the fonts look extremely ugly. Hinting on antialiased fonts was a complete misapplication of an earlier display kludge.

    This work illustrates this perfectly. No need for debates, look at the images and learn. Well done and kudos for an awesome and simple piece of work.

THEGODDESSOFTHENETHASTWISTINGFINGERSANDHERVOICEISLIKEAJAVELININTHENIGHTDUDE

Working...