Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



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:
  • Broken HTML (Score:0, Informative)

    by Anonymous Coward on Wednesday March 06, 2002 @02:44AM (#3116861)
    The HTML is seriously broken on the xfthack page. Ugh.
  • ClearType? (Score:4, Informative)

    by Latent IT ( 121513 ) on Wednesday March 06, 2002 @02:49AM (#3116876)
    I get the feeling that there is still work to be done, though. If you have windows xp, it's worth turning on the ClearType setting in Display -> Appearance -> Effects. XP starts as anti-aliased, but ClearType brings an even greater level. Of course, if you haven't seen ClearType in action, it's hard to expect improvement from plain old win2k. But the font improvements shown above in XFree are amazing, like night and day, no more blocky p's and q's at the wrong font size, which will make a lot of happy people at non MSFT boxes. =)
  • by thesupraman ( 179040 ) on Wednesday March 06, 2002 @02:50AM (#3116881)

    Having worked with GOOD font rendering software (mainly for broadcast television) I can say that most gui renderers do a pretty horrible job.

    It's not that they get the font shape wrong, or don't antialias correctly, it's that they don't allow for how people see things, and just antialias 'mathmatically correct'.

    With the fonts we use for television character generaters, several seperate rendering passes are used to give:
    1 - a solid and anti-aliased 'interior' to the font (this is 'normal' antialiasing)
    2 - a perimeter or border to the font, in a slightly different colour/darkless level, to make the edge stand out
    3 - a seperate rednering to the alpha channel to stop the font from 'blending' excessivly at the edges with the background (ie: a buffer zone).

    This makes a MASSIVE difference to the quality of the fonts, especially on anything other than a solid colour background.

    unfortunately, no OS as yet does this for it's screen display fonts, which is a pity, as it makes a BIG difference.

    Having said that, I'm VERY happy that improvements are happening, as good font rendering makes a hugh difference to the effort required to read text.
  • Comment removed (Score:5, Informative)

    by account_deleted ( 4530225 ) on Wednesday March 06, 2002 @02:56AM (#3116896)
    Comment removed based on user account deletion
  • Re:ClearType? (Score:3, Informative)

    by Eugenia Loli ( 250395 ) on Wednesday March 06, 2002 @02:56AM (#3116899) Journal
    Yes, this is true. WinXP's Clear Type is more advanced than the traditional anti-alias true type rendering, but it is valid ONLY for LCD screens, *not* for CRTs. I think this post here [macslash.com] is pretty informative on Clear Type... :)
  • just the hinter (Score:5, Informative)

    by Bistromat ( 209985 ) on Wednesday March 06, 2002 @03:04AM (#3116910)
    All that this guy did was disable the hinter in xft. The hinter in xft was notorious for being a piece of crap, and in fact there are makefile flags to compile it without hinting enabled. Thankfully, the next version is supposed to handle hinting, which is unique to each font, more gracefully.
  • by thesupraman ( 179040 ) on Wednesday March 06, 2002 @03:11AM (#3116927)

    Hmm, I guess we don't do real time text then, damn, I was pretty sure that was what I did, certainly looks like it, I must have been dreaming...

    Of course, there IS a difference when you need to display a full page of scrolling text at speed, but since characters are normally only rendered once each, and then cached, the processor time required to do high quality anti-aliased text is actually very very small in relation to just about everything else (laying out the text is a much more processor intensive task for most uses).

    The time required to properly alpha-blend it is a little higher (depending on the windowing system and graphics hardware), but still not that great.

    One BIG thing that gets missed is the fact that antialiasing for LCD is quite different from antialiasing for trinitron, which is quite different for antialiasing for a standard CRT, due to dot placement/shape, and that also makes quite a difference (I believe microsoft has an LCD mode, and freetype can do one, from memory).
  • Re:ClearType? (Score:5, Informative)

    by taion ( 304184 ) on Wednesday March 06, 2002 @03:34AM (#3116957) Homepage
    XFree86 4 supports sub-pixel anti-aliasing (aka ClearType). You just need to put match edit rgba=rgb; in XftConfig.
  • Greetings. (Score:5, Informative)

    by Anonymous Coward on Wednesday March 06, 2002 @03:54AM (#3116993)


    Here's another mirror [geocities.com]. Sorry about those stupid ads.

    I also want emphasize one thing that I say on the website. I can't take a whole lot of credit for the improvement. For sure, the freetype project and Keith Packard, author of XRender and Xft did all of the hard work. I just tweaked a few settings (adjusted glyph proportions and turned off hinting).

    David Chester

  • by Error27 ( 100234 ) <error27 AT gmail DOT com> on Wednesday March 06, 2002 @04:03AM (#3117011) Homepage Journal
    >>Not to troll, but this is exactly the kind of thing that has much more effect than technical people believe.

    Most people believe it.

    It's possible to get fonts to look correct... My fonts look fine. The real trick I think, is to get fonts working right by default.

  • Xft and fontconfig (Score:4, Informative)

    by po8 ( 187055 ) on Wednesday March 06, 2002 @04:23AM (#3117057)

    XFree86 4 supports sub-pixel anti-aliasing (aka ClearType). You just need to put match edit rgba=rgb; in XftConfig.

    Ah, how intuitive... how many hours of reading manpages, HOWTOs and FAQs did it take to figure that one out?

    Be patient. Keith Packard is pretty well done with his design and implementation of a new font selection configuration mechanism currently known as "fontconfig". Fontconfig separates the font selection from the rest of Xft, allowing other applications such as printer drivers to select fonts using the same mechanism and policy as X applications.

    In the process, fontconfig replaces the arcane Xft configuration language with an XML DTD. This should allow easier hand-editing of this configuration. More importantly, it should allow GUI toolkits such as KDE and Gnome to easily put a GUI interface on font selection configuration. Hopefully, in a few months you'll be able to just click a button to get sub-pixel font rendering with Xft.

  • Re:ClearType? (Score:4, Informative)

    by frantzdb ( 22281 ) on Wednesday March 06, 2002 @04:42AM (#3117080) Homepage
    With X, just add match edit rgba=rgb; to /etc/X11/XftConfig to get ClearType fonts in X.

    --Ben
  • by Raphael ( 18701 ) on Wednesday March 06, 2002 @04:47AM (#3117090) Homepage Journal
    It doesn't seem to display correctly in ns4. I had to use "view source" in order to read any of the text and get the url of the pictures.
    Probably you need to double check your table html.

    This is not only a problem with Netscape. The HTML code of the page is broken: there is a <table> tag at the beginning of the page and it is never closed. The table structure is incorrect anyway, because the <table> tag is immediately followed by <td> without a <tr>. The same problem occurs for a <center> tag and a <font> tag that are never closed (besides, the <font> tag occurs just before a block-level <h2> tag, so it should have no effect). Also, all color specifications are incorrect: missing quotes, missing "#" sign before the hex values.

    MrP- [slashdot.org], if you are mirroring this slashdotted page, it would be a public service to fix the most obvious errors so that the mirrored page can be viewed by most browsers and passes at least some minimal HTML validation tests. The easiest way to fix the problem would be to remove the offending tags (2nd, 3rd and 4th line in the original page).

    I highly recommend checking the page with HTML Tidy [sourceforge.net] or with the W3C validator [w3.org].

  • by Adnans ( 2862 ) on Wednesday March 06, 2002 @05:04AM (#3117117) Homepage Journal
    This [xfree86.org] might explain why client-side rendering was chosen. There are pros and cons but the pros seem to outweight the cons by far.

    The biggest advantage of this scheme by far is that you don't have to have any magic support for antialiased fonts in your toolkits

    This doesn't seem to be a problem since most populair toolkits already support the Render extension. Remember, RENDER is a completely new rendering system for X, not just anti-aliasing.

    ...even Athena widgets...

    If there was great demand for this it would already have happenend don't you think? Changing the Xaw toolkit to support RENDER would not be too hard I think.

    -adnans
  • by Adnans ( 2862 ) on Wednesday March 06, 2002 @05:17AM (#3117138) Homepage Journal
    Ah, how intuitive... how many hours of reading manpages, HOWTOs and FAQs did it take to figure that one out?

    It could have taken you one Google search for "xfree86 subpixel rendering" to find this [jmason.org] link!

    -adnans
  • Re:AA text fuzzy? (Score:3, Informative)

    by frantzdb ( 22281 ) on Wednesday March 06, 2002 @05:18AM (#3117141) Homepage
    It is available for X. See my other post on this page.

    --Ben
  • Re:My AA issue (Score:2, Informative)

    by PlazMatiC ( 11127 ) <slashdot AT plaz DOT net DOT nz> on Wednesday March 06, 2002 @05:43AM (#3117175) Homepage
    libgdkxft, which does subpixel antialiasing, is apt-gettable in debian woody.
    All you need to do after apt-getting the packages is install a bunch of truetype fonts, then add the line 'export LD_PRELOAD=/usr/lib/libgdkxft.so' to your ~/.xession or some other appropriate location:
    I had some issues getting it all working, but that was mostly user error. (I'd been playing with xfstt shortly before trying gdkxft and they seemed to interfere with each other)
    A good howto on setting it up is here [jmason.org]
    It makes mozilla look really pretty =)
  • Re: Shitty browser (Score:4, Informative)

    by HeUnique ( 187 ) <hetz-home AT cobol2java DOT com> on Wednesday March 06, 2002 @05:45AM (#3117180) Homepage
    On the contrary...

    If there is a browser that you got a chance to see an IE only web site is Konqueror on KDE 3.0 - it got the most compatible with MSIE javascript and rendering techniques...
  • by YellowBook ( 58311 ) on Wednesday March 06, 2002 @07:24AM (#3117384) Homepage
    Maybe it's because I'm using subpixel rendering
    on my LCD screen right now, but the 'after' images
    look much worse than the regular XFT rendering to
    me.
  • by BigSven ( 57510 ) on Wednesday March 06, 2002 @10:22AM (#3118030) Homepage
    Actually the result of hinting depends on two things. First, the font needs to be hinted well. Unfortunately only very few fonts are well-hinted. For those that aren't it makes indeed sense to turn hinting off entirely. Second, your font renderer needs to support the hinting information embedded into the font.

    TrueType fonts have bytecode with hinting information that can be interpreted by the renderer. This is what freetype-2.0 did up to version 2.0.1. Due to patent issues this feature was turned off by default in version 2.0.2. All newer versions of freetype use something what they call autohinter. While this gives better results for badly hinted or unhinted fonts, it does not (yet) achieve the excellent results you get from using the hints embedded in well-hinted fonts.

    The solution is thus not to disable hinting but to enable the bytecode interpreter in your freetype2 libs. Of course you also need some decent fonts.
  • by Acous ( 141729 ) on Wednesday March 06, 2002 @10:37AM (#3118160) Homepage Journal
    This is because XP uses 'hinting' which is disabled in the xfree hack. try doing a side by side comparison of normal xfree antialiased text against XP, it should appear closer. freetype hinting is not yet as good as windows.
  • by brucet ( 42348 ) on Wednesday March 06, 2002 @10:47AM (#3118252)
    Check out the XFree86 Font De-uglification HOWTO [linuxdoc.org].

    It has a lot of information on font rendering in X11 and following its advice can really make a big difference in improving the look of the fonts, (especially in Netscape I found).

    -Bruce

  • by daw ( 7006 ) on Wednesday March 06, 2002 @01:58PM (#3119645)
    It's true, disabling hinting is just plain stupid. The real problem is that TrueType font hinting is patented (by Apple!) and so though the freetype library (used by Xft for font rendering) has the code to do it properly, it's disabled by default in favor of an "automatic hinting engine" that probably makes things worse. So I'm not surprised that disabling hinting in a default build of freetype makes things look better. But it's a really dumb way to proceed.

    The right solution is to recompile freetype with the patented hinting turned ON, and the automatic hinting engine turned OFF. It really looks good, way better than either of that guy's screenshots.
  • by spitzak ( 4019 ) on Wednesday March 06, 2002 @03:56PM (#3120452) Homepage
    The sRGB standard is this (sorry it ate the lessthan sign):

    V = B < .04045 ? v/12.92 : pow((v+.055)/1.055, 2.4)

  • by acoopersmith ( 87160 ) on Wednesday March 06, 2002 @05:16PM (#3120994) Homepage Journal
    Sun is working on advanced font rendering and layout in the X server. The project is still in the early stages of development, but since it's open source, you can see what's there so far at http://stsf.sourceforge.net/ [sourceforge.net].

"If it ain't broke, don't fix it." - Bert Lantz

Working...