Slashdot Mirror


The Next XFree86 Wars: XFT2 vs STSF

NoSun writes "Sun's latest project is to create a font library for XFree86, named Stsf, that would replace Fontconfig and Xft2. But the big question is: Does the world need yet another X font library that would create more incompatibility and fragmentation? Well known Gnome and GTK+ developers are against this (yet another) X font library which just re-invents the wheel one more time with the result of slowing down KDE and Gnome in the desktop race. "

17 of 243 comments (clear)

  1. Still inferior by Drunken+Coward · · Score: 3, Informative

    The font rendering system in Windows is still vastly superior to any free implementation. Fragmentation will only further this problem.

    Competition is a good thing, but in this case collaboration is even better. The more situations we have like this, the longer it will take for Linux to be ready for the desktop.

    --
    Have you been stalked by Seth today?
    1. Re:Still inferior by Fnkmaster · · Score: 5, Informative
      This isn't quite so true anymore. The font rendering on a modern distro (I'm using Mandrake 9.1 right now) looks comparable to or better than the font rendering on my Windows box. At least, when it's using _good_ True Type fonts, anti-aliasing, hinting, and so forth enabled in FreeType. I've seen some intermittent kerning problems in slightly older versions of FreeType (like in Mandrake 9), but these appear to be largely resolved now. For example, reading CNN or Slashdot in Konqueror, or Phoenix, on my Linux box, it's comparable in readability to on my Windows box.


      That being said, there is still a mess behind the scenes with font rendering. These non-TrueType legacy fonts sitting around should just go away. The frustration that sometimes, mystically, some fonts get anti-aliased and some don't - this isn't something end-users should have to deal with (and to the credit of the Mandrake people, I haven't yet seen any of these problems with the default fontconfig in 9.1). The real problem is the mixing together of all the "legacy" X11 fonts for old school X Windows apps with new TrueType fonts used in modern XRender/Xft apps. This creates a font management nightmare. What's worse is none of the font management programs make all this stuff crystal clear and usable, even for an experienced user.


      So yes, font management is still a big thorn in the side of the X Window System, though it's much better now than it used to be, with Xft/XRender. I don't really see why we would do anything other than A) incrementally improve those and B) make the old rendering system OPTIONAL and try to get everything in modern Linux distros ported over to used the new X rendering infrastructure.


      Rather than writing new font management subsystems for X, perhaps we should look for the longer term to alternatives to X, architectures that are cleaner for a desktop environment, where we can provide source-level compatibility for Qt and Gtk apps, and make the old X protocol a strap-on (like running an X server on a Windows box, or on Mac OS X), so that people who need to run legacy X apps can still do so, but that those who want a cohesive, aesthetically pleasing, easy-to-use desktop environment can get it.

    2. Re:Still inferior by cxvx · · Score: 5, Informative
      Simply put I hate Sun and all their software products because they have REPEATABLY shown themselves to be the microsoft of unix-land.

      You mean that microsoft has given things like NFS, Pam, Openoffice.org, Netbeans, ... to the community?
      If only that were true, then we could use more "microsofts of the unix world" :)

      --
      If only I could come up with a good sig ...
    3. Re:Still inferior by be-fan · · Score: 4, Informative

      This is total bullshit. The guy knows nothing about Xft, Stsf, or FreeType.

      1) FreeType is *very* good. With TrueType hinting enabled, the output on a standard resolution LCD is *dead identical* with the output for the Windows rasterizer. On a high-res LCD, any version of FreeType with the improved autohinters is also extremely good. I personally prefer it to ClearType's rendering, for two reasons: it doesn't require sub-pixel AA (which still causes visible color fringing in Cleartype) to look sharp, and letter shapes look more natural (less hinted, but still sharp). If you don't believe me, look at screenshots of my desktop: this and this.

      2) Rendering quality has nothing to do with Xft vs Stsf. Neither of these font services do the actual rendering; that is still handled by FreeType. These services are for font finding and font matching.

      --
      A deep unwavering belief is a sure sign you're missing something...
    4. Re:Still inferior by Fnkmaster · · Score: 3, Informative
      I really recommend doing a full upgrade to 9.1 then. It uses the latest FreeType, comes with a pre-rolled Xft-enabled Mozilla 1.3, XFree86 4.3, and you can get all the addons (hacked FreeType with "patent-be-damned" features enabled, MSFonts RPM, etc.) from Texstar's RPM archive (which you can add easily to your urpmi media list for dumb-easy updating).


      All the "clipped font rendering" issues (like your clipped S and so forth) that I had with my older Mandrake 9 installation are finally gone with my current 9.1 install, and I finally feel comfortable enough looking at the fonts that I can imagine using this desktop a significant part of my day. And some of the KDE 3.1.1 styles (like liquid) have some truly slick eye candy to them. The big problem remaining here is X's window redraw speed when you move windows around and the like. Some have claimed that the 2.5.x Linux kernels fix this with some changes to timing or interrupt parameters to make a more "desktop-friendly" kernel (like that magic constant you used to be able to tweak in the kernel to get a much more responsive desktop). Of course, the distros should have been doing this all along to make a real out-of-the-box desktop GUI experience that works and feels qualitatively fast on all modern hardware. Until they get that working, Linux just ain't going to be ready for the desktop.

    5. Re:Still inferior by Fnkmaster · · Score: 4, Informative
      Well, I respectfully disagree. I think you and I basically see eye to eye on the idea of being able to make higher-level GUI API calls, and _presumably_, also having a higher-level protocol for communications between the "client" and "server" (or application and windowing system to get away from X terminology). We are in 100% agreement that a programmer should ALWAYS make an API call that says "render string 'foo' at location bar", rather than say "retrieve font bitmap foo, now do some internal font rendering in client, transmit back bitmap baz to server..." or whatever the hell goes in with the old school X infrastructure.


      XRender seemed to greatly improve font output quality in X. And I understand it, XRender and the Xft extensions basically do exactly what we both agree should have been done. In other words, it's already there. For example, Xft has the API call:



      void XftDrawStringUtf8 (XftDraw *d, XftColor *color, XftFont *font, int x, int y, XftChar8 *string, int len);


      Clearly this DOES let you draw a UTF-8 string on a button pretty damned easily. Now where we disagree is whether this is "good enough". I judge this based on opening up my KDE desktop and looking at the apps that I want to use. Evolution (which is better than Kmail), Phoenix, OpenOffice - shit, these are all Gtk applications. Oh wait, you mean Gtk apps don't look right with my KDE desktop? Separate themes, different theming functions (which I can't for the life of me figure out how to access without having Gnome on my machine). This is a nightmare.


      Face it. Windows at least strongly suggests policy for everything. You can always go and roll your own in Windows too. But all the normal desktop apps have consistent colors, toolbar structure, use the same fonts, render them through the same system, and so on. If everybody used Gtk or if everybody used Qt, I suppose there wouldn't be a problem, but they don't. I don't like people "innovating" with new GUI toolkits. If you need to create a custom widget for a specific app, fine, but I want one set of menus, one set of text drawing functions, etc.


      Perhaps it could be solved by a common theming system and some basic shared libraries that are developed cooperatively between Qt and Gtk so that they can still "innovate" separately all they want, but keep some of these basic functions consistent to guarantee a common look and feel without having to play ridiculous games looking for themes like BlueCurve specifically designed to look alike on both systems.

    6. Re:Still inferior by walt-sjc · · Score: 4, Informative

      Yeah, and he sure as hell did not read any of the docs at stsf sourceforge. There is a good side-by-side comparison of xft2 and stsf.

      It's quite interesting, and stsf looks like it may have certain advantages over xft2. xft2 for example does not do layout - that's an application thing (gnome uses pango according to the doc) and stsf DOES do layout. According to sun, stsf has a 30-200% performance improvement over xft2.

      stsf does NOT solve all the problems with X fonts however. They are still a god awful mess in regards to configuration.

    7. Re:Still inferior by iabervon · · Score: 2, Informative

      If only there were a function like Xutf8DrawString that would draw a UTF-8 string available if X_HAVE_UTF8_STRING were defined, along with a function like Xutf8TextExtents, and so forth...

      Er, right. If only there were a function like XftDrawStringUtf8...

      Er, right. Actually, programmers have been working on what you want. The programmers who matter for these purposes haven't been implementing buttons. Of course, the documentation, standardization, and popularization of this work has somewhat lagged, but UTF-8 string rendering has been supported by XFree86 since 4.0.2

    8. Re:Still inferior by 13Echo · · Score: 2, Informative

      Your problem is a result of the embedded Freetype libs in OpenOffice. You can force it to link to your system's libs, but it isn't perfect. Unfortunately, nobody can legally include the Freetype autohinter in their software because Apple owns a patent on the method for rendering the fonts.

  2. Re:restarting X by Jeffrey+Baker · · Score: 4, Informative

    Ignorance strikes again. It is not necessary, just add a font to the fontconfig directory (~/.fonts, for a user), and the font will be available via fontconfig/xft2. For core fonts you need xset fp rehash. In no case do you need to restart the XFree86 server.

  3. Re:XFT2 needs the XRender XFree86 extension ... by Anonymous Coward · · Score: 2, Informative
    Well, Solaris 2.9 does come with the XRENDER extension.

    Unfortunately it does not work.

    The real underlying problem (for Sun) is that the XRENDER extension requires 32-bit frame buffers. Sun's (at least most of their) frame buffers support 8 bits and 24 bits and maybe 1 bit. Sun's bogus XRENDER probably exists in order to please {Star,Open}Office which may only need the 8-bit part.

    Sun could probably upgrade the frame buffer drivers, but it is not clear that deployed cards have that extra 33% memory lying around. (For PC users that probably sounds so 1980-ish. Sorry, but that's the world on Sun.)

  4. Sun fonts vs. OSS fonts by lindsayt · · Score: 2, Informative

    I don't know much about this whole thing. All I know is that I use a Sun for my desktop instead of my RedHat 7.3 box precisely because Sun's fonts are so much better than the ones in RedHat 7.3. Fonts in Solaris are substantially comparable to those in Windows, whereas those in Red Hat still lag behind.

    Whether this has any bearing on the specific issue of XFT2 vs. STSF, I don't know. Perhaps the proposed STSF doesn't even resemble the font set in Solaris, and perhaps my RedHat font issues have nothing to do with XFT2. But regardless, I use Solaris on my desktop for font reasons, and I'm more likely to trust Sun's fonts than OSS ones simply because of my prior experience.

    Of course sometimes prior experience can cause people to be stubborn, ignorant and misinformed. I'll hope that's not the case here...

    --
    I did not design this game/I did not name the stakes/I just happen to like apples/And I am not afraid of snakes-AniD
  5. How this troll got Informative is beyond me by 21mhz · · Score: 2, Informative

    To everyone moderating the parent as Informative and Insightful: lay your crack aside.

    Graphics and CORBA are independent parts of the GNOME platform, that aren't necessarily used together.
    That, and other claims in the parent comment, are just rehashed old trolls. Move on.

    --
    My exception safety is -fno-exceptions.
  6. Re:Since it currently sucks... by dominator · · Score: 3, Informative

    Actually, Gimp and AbiWord use FontConfig/Xft2 either directly or indirectly (read: transparently) now, as can any GTK2 application. I suggest you go get gimp 1.3.12 and AbiWord 1.1.4. Ximian's OpenOffice will use Xft2/Fontconfig as well. Expect that to be released _soon_

    Having worked on these projects, I know all too well how bad it was. The font situation *was* deeply fragmented. Fontconfig made it all better. Let's not make it suck again. IMO, Sun would do better to simply support the Render extension on their XServers, or to improve the X backend to Xft2. It *can* be done. I'm dreading Sun's results. I'm afraid they've just made a lot more work for all of the users and hackers out there.

    Dom

  7. STSF is technically superior to Xft/Xft2/XRender by jeske · · Score: 2, Informative
    Even though they both can use FreeType as a rendering engine, these two APIs do not have the same rendering capabilities.

    Below I've listed several reasons that STSF is technically superior to Xft/Xft2. In addition, STSF is compatible with Xft, meaning that existing Xft applications to not have to be changed unless they want to use advanced STSF features which Xft does not provide.

    1. STSF supports non-rectilinear text, including text along shaped paths. Xft/Xft2/Pango, even with XRender, does not.

      When you consider that drawing through Xlib or XRender must use rectangular blocks, you will realize how hard it will be for client-side font rendering to ever efficiently support non-rectilinear text.

    2. STSF has higher performance rendering than Xft/Xft2.

      Graphics systems typically accelerate font rendering by caching unique rendered glyphs in video memory. With client-side rendering of glyphs, several applications cannot share the same rendered glyphs. The more applications you run on the machine, the more copies of the Arial 10pt letter "L" you will have.

      Another benefit of server-side rendering is better networked graphics performance. I constantly hear Linux/X developers defending X's network model over Windows' direct rendering model. Xft does not work well over a network, and Xft2/XRender have limitations over a network which are not present in STSF. As display dot-pitch increases this will only get worse for Xft.

    3. STSF can be made to render fonts for older applications using core X protocols. Xft/Xft2 is a client-side technology and cannot improve old applications.

      Xft/Xft2, because they are client-side technologies, require updating applications to get anti-aliased fonts. With STSF a server-side setting can enable antialiased fonts for old applications.

    Xft was great work. It has put a spotlight on XFree font rendering and provided a solution which works today. Now our goal is to have a world-class font solution which rivals MacOS and Windows. STSF has many important features and we would not be smart to dismiss it due to a political skermish about "letting go of existing work".

    DISCLAIMER: I have no connection with either XFree, Xft, Sun, STSF, or any font rendering gihad. The above statements are drawn from my own experience in the PC graphics hardware industry and time spent digging through information on Xft and STSF technologies. If you don't like what I have to say, my post comes with a money back guarantee.

  8. Nobody is looking at the technical issues! by Anonymous Coward · · Score: 1, Informative
    These are the advantages that Stsf seems to have over Xft.
    • It is a unified interface for all fonts so you call exactly the same functions for TrueType as type1 and Speedo, unlike Xft which only deals with some font types. The current API is messy and should be replaced with a font-independant one like Stsf.
    • It has a server side extension, which can take an entire font vector (string?) and render it in one go which is fast... Xft requires the client to do the rendering and use XRender to alpha-blend it to the background - this is slow and inefficient.
    • Stsf provides an Xft compatability layer, Xft apps can run unmodified.

    And the advantages of Xft
    • It already exists and has a lot of software that uses it.
    • It has a nice config file ;)

    As a programmer I know which I would rather use...
  9. Answer and it is not re-inventing the wheel by pamri · · Score: 2, Informative
    The specs are open, but the implementation is patented. ie., you can create a opentype font and release it under any license even GPL and adobe won't do anything, but the patent is on the method. Again, IANAL, but one of my friends, who is a lawyer is researching this stuff, since we use OTF'S a lot and i will try to put his research online.

    I disagree it is reinventing the wheel, but rather it prevents reinventing the wheel, since now OTF'S are being developed for each toolkit, like gtk uses pango, while the qt guys are developing their own. Having such a important feature at the X-server level is good.

    Please refer to my previous post on why OTF'S are so important.