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. "
One of the things that's always struck me about X is that the type rendering is poor, compared to the state-of-the-art rendering on contemporary commercial OSes. This has been true, in my personal comparisons, over many years. (I.e., as X advances, so does the state-of-the-art, making relative progress nil.)
I remember when I worked at Be, we licensed a renderer from Bitstream, specifically because writing a really good type renderer is exceptionally hard.
Perhaps this is an area where Open Source nees a leg up from a well-funded commercial outfit, like Sun. Can anyone comment on the actual quality of this new library, relative to existing solutions?
- If Sun's project is vastly inferior, no one will use it and it won't cause "fragmentation".
- If Sun's project is vastly *superior*, then the people who switch to it will enjoy a great implementation. You shouldn't force Sun to collaborate in this case. Mozart's compositions wouldn't be as good if he had been forced to "collaborate" with the inferior composers of his time.
- It's only if Sun's project is "comparable" to previous projects that it will cause fragmentation.
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.
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.
...I would welcome some kind of change.
As someone new to the internals of X (but not Unix) it took me the better part of a day to sifting through out-dated documentation and installing font software and scripts for previous versions of X and hacking out the bugs, just to get the CorelDraw fonts I paid for to be available in the GIMP. In hindsight I can see how I could have done it in about 20 minutes, but it was anything but friendly.
Havoc makes a good point:
You also still have to show the server-side stuff working with good performance and real-life significant memory savings.
But one can't put something to that test unless one develops it.
It basically comes down to: If a corporation is going to invest money in an open source development they are going to have some influence on how it's spent (in this case in terms of man hours). This influence may not be considered optimal to the other people in the movement, but it is Sun's money to spend.
And since I'm running RH 8.0, and OpenOffice, GIMP and AbiWord all have completely different font selections, I can't really see how it's going to get more fragmented.
Thank you for your efforts Sun Microsystems, I'm anxious to see the reuslts.
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
How open is Opentype?
Do not read this
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...
Sheesh.
That means STSF doesn't have to be just a little bit better, it has to be VASTLY better to justify ripping out a brand new font architecture. Nobody is convinced it is.
Other people seem to be of the belief that having 2 competing font systems is ok. It's not - this is two competing interfaces, NOT implementations. Well, STSF can apparently emulate Xft, but you don't get any advantages that way, so what's the point?
So STSF had better be pretty amazing to justify it. Sure, Sun can go and use it if they like, but it'd require major b0rkage of GTK, and those patches would probably not make it back into the trunk, so they'd have basically forked GTK. Not good.
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.
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.