After upgrading to cairo 1.0.4 (from 1.0.2) I noticed that fonts in GTK apps are no longer subpixel rendered. Instead, plain gray antialiasing is used. Changing font rendering parameters in GNOME's font capplet do not produce difference between grey aliasing and subpixel rendering. I recently upgraded Pango from 1.11.99 to 1.12.0, but I noticed improper rendering after upgrading cairo. What interesting, GNOME Terminal (or rather vte widget) DO react to capplet changes and properly renders text with subpixel hinting. Other GTk widgets (like menu bars, buttons etc.) render text all grey :(
Vte doesn't use Pango or Cairo, so it's expected that it doesn't change. Neither Matthias Clasen can reproduce this, nor I. And I reviewed all the commits between 1.0.2 and 1.0.4. The only interesting commits are two patches from Frederic Crozat, one for supporting BGR subpixels, another to match our hinting/subpixel code to the recommended usage by David Turner and that of Xft. Those two patches look very good and I doubt they break things. Do you happen to set to BGR instead of RGB by any chance? The only possibility I see, reading the patch; if you compile cairo against an ancient version of FreeType headers, it will disable subpixel. What versions of FreeType do you have around? Did you happen to upgrade FreeType recently too?
I'm using Slackware -current. The FreeType library is included in package for Xorg-6.9. Documentation dir is called freetype-2.1.9. freetype-config --version shows 9.7.3, and library is called libfreetype.so.6.3.7. It haven't changed since middle of January, when the X11 package was upgraded.
Now it got interesting. 1. I upgraded to "official" (from distribution) cairo-1.0.4, which appeared in Slackware yesterday. Result: grayscale rendering. 2. I downgraded to cairo-1.0.2 which I had compiled and used earlier. Result: color subpixel rendering. 3. I recompiled 1.0.2 and installed it. Result: gray rendering!!! Any specific hints about which test in configure could fail and disable subpixel rendering?
No, no configure test. It's definitely something like the wrong FreeType or fontconfig headers being used compiling cairo.
Could you guide me to place in code which disables subpixel rendering? I'd like to debug this issue, but now I don't know where to start.
(In reply to comment #5) > Could you guide me to place in code which disables subpixel rendering? I'd like > to debug this issue, but now I don't know where to start. There's no specific code that disables subpixel rendering. Something is just not working correctly. As you've now discovered, the code in cairo 1.0.2 is capable of doing supixel rendering when compiled and linked appropriately. So what you'll have to discover now is what differences exist between how the working and non-working versions are being compiled and linked.
You may want to contact your distribution about the issue.
After consulting with distribution, error is probably caused by Xorg 6.9.0, as cairo compiled with Xorg 6.8.2 works fine. As I want to get rid of this bug, I ask you again: what could be wrong? You twice stated "something". If there are circumstainces when cairo disables subpixel rendering, there must be some "if ()" statemnt in code which disables it. Or maybe some "#ifdef" or similar measure. Please, tell me where I should start looking. Where Cairo checks if headers are "ancient"? Any hints?
If you really are down to getting into the code, a simple grep would show where it is. It's in src/cairo-ft*. Look for RGB... There are a few ifdef's around there.
The actual problem is fontconfig, not freetype. Fontconfig 2.3.x is required for subpixel rendering to work. The Xorg page rather boldly states that 2.2.3 is the recommended release (and this is what is included in the slackware 6.9 packages). I built 2.3.2 here and then rebuilt cairo and things are back to normal. I did not need to rebuild freetype (although I tried and noticed that 2.1.10 looked worse than 2.1.9).
After long analysis of those files and previous Xorg releases, I've failed to discover why 1.0.2 worked for me. But problem got solved in meantime. Philip, could you ping Patrick (volkerdi@) and ask him to ship newer fontconfig?
Another data point: color subpixel redenering works in Firefox Web Browser 1.5.0.3 from Slackware package. But it still broken in other GTK apps.
This is a distro problem. And no, Firefox isn't really a Gtk+ app, and doesn't use cairo yet.
Then Firefox make a good work with URL entry, search entry, menu bar and tabs all looking like GTK.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.