FS#5003 - Cairo problems after update to 1.2.0

Attached to Project: Arch Linux
Opened by Douglas Soares de Andrade (dsa) - Sunday, 09 July 2006, 11:46 GMT
Last edited by Tobias Powalowski (tpowa) - Monday, 10 July 2006, 07:07 GMT
Task Type Bug Report
Category System
Status Closed
Assigned To Jan de Groot (JGC)
Architecture not specified
Severity Medium
Priority Normal
Reported Version 0.7.2 Gimmick
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

After this update the fonts in my gtk apps are really messed up. I saw that a user in forums are with the same problem:

http://bbs.archlinux.org/viewtopic.php?t=23082&highlight=cairo

I downgraded the older version and it worked. Any ideas or im missing something ?

Thanks
This task depends upon

Closed by  Jan de Groot (JGC)
Friday, 04 August 2006, 06:05 GMT
Reason for closing:  Fixed
Comment by Jan de Groot (JGC) - Sunday, 09 July 2006, 12:03 GMT
Please supply us with screenshots. I've been running beta versions of 1.2.0 for two months on CRT and TFT screens and haven't noticed any differences in rendering quality, not on Xorg 7.0 and not on Xorg 7.1, so I need screenshots to see what actually is wrong then.
Comment by Eyolf Østrem (eyolf) - Sunday, 09 July 2006, 14:00 GMT
I have the same problem: the fonts are no longer anti-aliased. See screenshot.
Comment by Skottish (skottish) - Sunday, 09 July 2006, 16:14 GMT
Same deal. Attached Firefox and Gimp pic.
Comment by asd asd (izaak) - Sunday, 09 July 2006, 16:21 GMT
Are you guys all running KDE with gtk-qt-engine? That's my setup, and I'm having the same problem. A work-around is to startup gnome-control-center and enter the 'fonts' configuration. Applications started thereafter will have the correct font settings. This gives me a hunch that there was an incompatibility with gtk-qt-engine introduced in the recent batch of updates.
Comment by Eyolf Østrem (eyolf) - Sunday, 09 July 2006, 16:59 GMT
Yep, KDE with gtk-qt-engine it is. About the workaround: I don't have gnome-control-center, and I don't think I want one either. Guess I'll just have to wait for a fix.
Comment by asd asd (izaak) - Sunday, 09 July 2006, 17:23 GMT
well, i talked to someone on IRC who actually doesn't run KDE and they're experiencing the same problem...

still, if you want a work-around, i think running /opt/gnome/libexec/gnome-settings-daemon on startup should do the trick (that is, if you have the control-center package installed and you've correctly configured your font settings through it)

personally i downgraded rather than have another useless task running :)
Comment by Douglas Soares de Andrade (dsa) - Sunday, 09 July 2006, 17:33 GMT
Yes,

Im running kde with gtk-qt-engine... I downgraded too. But im using clearlooks as gtk theme. Removing gtk-qt-theme helps ? (Im away from my box).
Comment by sameat (sameat) - Sunday, 09 July 2006, 17:46 GMT
I am running kde, but no gtk-qt-engine. I had the ugly font problems (above screenshots look about right) until I downgraded cairo to 1.0.4-1. I use an LCD.
Comment by Jeremy M. (jskier) - Sunday, 09 July 2006, 20:46 GMT
I am having the same problem, but only on my laptop, not my desktop (both are LCD screens). Not sure if it matters but the desktop uses an Nvidia GPU and the laptop ATI. Downgrading worked for me as well.
Comment by Jan de Groot (JGC) - Monday, 10 July 2006, 06:13 GMT
Could you supply me with a tarball which contains:
- /etc/fonts and all files/symlinks in it
- ~/.fonts.conf
Comment by Eyolf Østrem (eyolf) - Monday, 10 July 2006, 08:23 GMT
Here you are
Comment by Jan de Groot (JGC) - Monday, 10 July 2006, 09:44 GMT
I see you have bitmap fonts enabled. I guess this is the source of the problem: somehow bitmap fonts are not anti-aliased and are prefered over scalable fonts in the current fontconfig configuration. I still want to have the bitmap fonts enabled again, but as long as this is the side-effect, it will remain disabled by default.
Comment by asd asd (izaak) - Monday, 10 July 2006, 12:52 GMT
I don't know if that's the same case for me... If so, could you explain how we do as you're describing to fix it? Thanks!
Comment by Jan de Groot (JGC) - Monday, 10 July 2006, 13:00 GMT
In your case, AA for fonts smaller than 10 points is not anti-aliased, which means most fonts won't get anti-aliased. You don't have bitmap fonts enabled as in the other case, so that shouldn't get messed up.
Comment by asd asd (izaak) - Monday, 10 July 2006, 13:17 GMT
I don't think we're getting anywhere. All my application fonts are >= 11 pt, and everything works as expected. With the cairo upgrade there is no AA at all.
Comment by Eyolf Østrem (eyolf) - Monday, 10 July 2006, 16:29 GMT
2JGC:
I've compared my tarball with izaak's, and the only substantial difference I could find regarding bitmaps was to which file the bitmaps symlink led to. I changed that to no-bitmaps.conf, and ... no difference.
I've also tried to downgrade, but I need a lower version of pycairo, the cache of which I seem to have deleted. Does anyone have an old copy which is compatible with cairo v. 1.0.4?
Comment by Douglas Soares de Andrade (dsa) - Monday, 10 July 2006, 16:56 GMT
Here.
Comment by Eyolf Østrem (eyolf) - Monday, 10 July 2006, 17:13 GMT
thanks!
Comment by David Rosenstrauch (darose) - Monday, 10 July 2006, 20:56 GMT
I'm having rendering problems too. See the attached screenshots. The first shows how one of Firefox's pull-down menus renders when I first pull it down. The menus only render properly (as in the 2nd image) when I run the mouse over each of the menu options.
Comment by David Rosenstrauch (darose) - Monday, 10 July 2006, 21:06 GMT
Looks like downgrading cairo (to 1.0.4-1), pycairo (to 1.0.0-1), and pygtk (to 2.8.6-1) works around the problem.

Is this an upstream problem with cairo?
Comment by Jan de Groot (JGC) - Tuesday, 11 July 2006, 06:32 GMT
Could you try updating pango to 1.13.2 from testing? Could be a small incompatibility between pango 1.12.x and cairo 1.2.x.
Comment by Eyolf Østrem (eyolf) - Tuesday, 11 July 2006, 06:59 GMT
I've tried, but no luck.
Comment by Jan de Groot (JGC) - Tuesday, 11 July 2006, 07:31 GMT
Does anyone of you use testing, or are all these systems running current. Also, does the problem disappear when switching to some other theme engine than gtk-qt-engine?
Comment by David Rosenstrauch (darose) - Tuesday, 11 July 2006, 11:35 GMT
In answer to question #1, I run current, not testing.

In answer to question #2, what do you mean? What other theme engines are there?
Besides, I don't know if it's relevant or not, but I tried running a different WM instead of KDE (e.g., IceWM, and even Gnome itself) and I still had these rendering problems.
Comment by Jan de Groot (JGC) - Tuesday, 11 July 2006, 11:59 GMT
Try uninstalling gtk-qt-engine and run your GTK program again, it will look shitty as it reverts to the simple theme engine included in GTK, but at least you can see if it affects font rendering then.
Comment by Skottish (skottish) - Tuesday, 11 July 2006, 16:11 GMT
I was running KDE without the gtk-qt-engine before when I sent my screenshot. I went ahead and tried installing it and the results are identical.
Comment by Jan de Groot (JGC) - Tuesday, 11 July 2006, 18:07 GMT
@David Rosenstrauch: your GTKProb1 and GTKProb2 screenshots looks familiar to https://bugs.freedesktop.org/show_bug.cgi?id=6617#c1, same issues. As it seems, this bug was already present in 1.0.4 if I have to believe the bugreport, but only in bitmap fonts. During the transition to 1.2.0, the bug appears for all fonts, but as it seems, only outside of GNOME environments somehow.

About the anti-aliasing problems: this bug has been introduced somewhere in the 1.1.x development releases and is caused by one of the commits in this big diff:
http://gitweb.freedesktop.org/?p=cairo;a=commitdiff;h=b0c58593b30c1fa085b1e7c8e4897da623b8686d

I'll try to revert small pieces later today or tomorrow to find out which piece of the commit is causing it.
Comment by David Rosenstrauch (darose) - Tuesday, 11 July 2006, 18:35 GMT
Yes, it looks like that bug might be the culprit.

FYI, though - I was seeing this bug under GNOME too. (In fact, when running GNOME, the GNOME panel itself was experiencing these rendering probs., and not just GTK-based apps.)

So what's the situation, then: are we to wait for an upstream fix on this? It looked like your comment about reverting was only in reference to the anti-aliasing probs.
Comment by Jan de Groot (JGC) - Tuesday, 11 July 2006, 21:47 GMT
The freedesktop bugreport contains some references to patches that might help out.

Trying to reproduce this bug on my system succeeded only in one way: telling KDE not to anti-alias fonts of a certain size. Somehow cairo looses track at that moment and decides to exclude all fonts from AA. My guess is that cairo doesn't provide the correct fontsize to freetype2/fontconfig (possibly even 0 points), which makes fontconfig believe the fonts shouldn't be hinted.
Comment by Skottish (skottish) - Tuesday, 11 July 2006, 23:42 GMT
I'm going to bump part of this thread to a Firefox rendering problem as noted by darose. It seems that it's not the same as the anti-aliasing problem.
Comment by David Rosenstrauch (darose) - Wednesday, 12 July 2006, 04:12 GMT
That's not entirely correct. It's not a Firefox-specific problem. It's a separate bug in cairo from the anti-aliasing problem, which affects all GTK-based apps (firefox, thunderbird, gnome-panel, etc.)
Comment by Skottish (skottish) - Wednesday, 12 July 2006, 13:41 GMT
My apologies. Thanks for clarifying this.
Comment by David Rosenstrauch (darose) - Monday, 17 July 2006, 11:55 GMT
Has there been any progress on this bug? I'm still running with downgraded versions of cairo, pycairo, and pygtk.
Comment by Jan de Groot (JGC) - Thursday, 27 July 2006, 14:41 GMT
For the ugly fonts that don't get hinted anymore: this is a bug in cairo 1.0.4 that has been fixed in 1.2.0. No really, when you ask for unhinted fonts in cairo 1.0.4, you don't get them. This is fixed in 1.2.0.

Take a look at ~/qt/.qtrc, check for these lines:
enableXft=false
useXft=false

Put them to true and hinting should be enabled again, or add these lines and set them to true.

About the corruption: this has been fixed in cairo GIT, I'll apply the patch later today or tomorrow to our cairo package The bug isn't in cairo actually, but in X.Org when rendering without EXA. The patch for cairo just workarounds the bug. Somehow X.Org will stop rendering when a 0-sized glyph gets rendered, so cairo just makes sure X.Org doesn't get these glyphs rendered.
Comment by asd asd (izaak) - Thursday, 27 July 2006, 17:35 GMT
JGC, I don't understand. I think of us are having a problem getting any AA. "No really, when you ask for unhinted fonts in cairo 1.0.4, you don't get them" - I don't think my font configuration is asking for unhinted fonts - it's posted somewhere above if you'd like to check.

I couldn't find the lines you specified in ~/.qt/qtrc . Why would that affect GTK apps, anyways?
Comment by Jan de Groot (JGC) - Thursday, 27 July 2006, 21:19 GMT
Starting from KDE 3.5.3, KDE sets anti-alias settings via the XSettings protocol (rdb). KDE 3.5.3 contains a bug in doing so, which disables AA always, until you start gnome-settings-daemon which enables it again. Cairo 1.0.4 didn't listen to these settings and couldn't disable AA at all, but cairo 1.2.0 listens to these settings and disables them "as requested" (no you didn't, but KDE tells cairo to do so).

KDE 3.5.4, which is released shortly, should fix this problem. I've tested with KDE 3.5.3, which indeed turns off all AA. Having pre-release KDE 3.5.4 packages installed, AA is turned on and applications look fine again.
Comment by asd asd (izaak) - Thursday, 27 July 2006, 21:45 GMT
Yay! Thanks for the description.
Comment by asd asd (izaak) - Sunday, 30 July 2006, 02:24 GMT
For anyone else anxiously waiting for this to be fixed, put this somewhere in your X startup:

echo 'Xft.antialias: 1' | xrdb -override

For example, those running KDE would put the above line somewhere in ~/.kde/Autostart/ .

Comment by asd asd (izaak) - Thursday, 03 August 2006, 00:00 GMT
I've upgraded to kde 3.5.4 and Xft.antialias is still 0. I tried moving my ~/.kde, ~/.qt, ~/.kderc, and Xft.antialias was still 0 on startup. Could this still be a KDE bug?

Yes, I have antialiasing turned on in KDE's font settings and qt apps of course look great.
Comment by Skottish (skottish) - Friday, 04 August 2006, 02:58 GMT
The solution found here:

http://bbs.archlinux.org/viewtopic.php?t=23743

works well with KDE 3.5.4. I am currently writing this with Cairo 1.2.0-2 installed and the fonts are perfect.

Loading...