Bug 451016

Summary: Qt3 xft'less font rendering is completely broken
Product: [Fedora] Fedora Reporter: Artem S. Tashkinov <aros>
Component: xorg-x11-serverAssignee: Adam Jackson <ajax>
Status: CLOSED WORKSFORME QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 9CC: ebusinux, me, xgl-maint
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-06-19 17:13:34 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
This is how fonts are rendered by Qt3 without libXft
none
KDE3 konsole (run with --noxft) with Xserver 1.5 none

Description Artem S. Tashkinov 2008-06-12 12:26:10 UTC
Description of problem: I need to run some Qt3 applications with disabled libXft
font rendering. After upgrading from Fedora 8 to Fedora 9 all those applications
stopped working correctly. Instead of fonts I see some unreadable garbage.

Version-Release number of selected component (if applicable):

How reproducible: Always

Steps to Reproduce:

1) install g++, qt3 and qt3 devel

2) cat main.cpp

#include <qapplication.h>
#include <qfont.h>
#include <qlabel.h>
#include <qframe.h>
#include <qlayout.h>
#include <qpushbutton.h>
#include <qfontdialog.h>

static bool s_antialias;

class MyWidget : public QFrame
{
    Q_OBJECT

    public:
        MyWidget(QWidget *parent = 0);
        void setVTFont(const QFont& f);
    public slots:
        void editFont();
};

#include "main.moc"

MyWidget::MyWidget(QWidget *parent) : QFrame(parent)
{
    s_antialias = true;
    QLabel *label = new QLabel("This is sample text", this);
    QPushButton *button = new QPushButton("Change Font...", this);
    connect(button, SIGNAL(clicked()), this, SLOT(editFont()));

    QVBoxLayout *layout = new QVBoxLayout(this);
    layout->addWidget(button);
    layout->addWidget(label);
}

void MyWidget::editFont()
{
    bool ok;
    QFont font = QFontDialog::getFont(
                    &ok, QFont( "Helvetica [Cronyx]", 10 ), this );
    if(ok)
    {
        setVTFont(font);
    }
}

void MyWidget::setVTFont(const QFont& f)
{
    QFont font = f;
    if (!s_antialias)
        font.setStyleStrategy( QFont::NoAntialias );
    QFrame::setFont(font);
    fontChange(font);
}

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    MyWidget *widget = new MyWidget;

    QString str(app.argv()[1]);
    if(str == "--noxft")
        s_antialias = false;

    widget->setVTFont(app.font());

    widget->show();
    app.setMainWidget(widget);
    return app.exec();
}

qmake -project
qmake
make

./application --noxft
  
Actual results: Garbage

Expected results: Normal font rendering

Additional info: I have tested this problem with nv and nvidia drivers.

Comment 1 Artem S. Tashkinov 2008-06-12 12:26:10 UTC
Created attachment 309057 [details]
This is how fonts are rendered by Qt3 without libXft

Comment 2 Artem S. Tashkinov 2008-06-12 15:10:34 UTC
My GPU is NVIDIA 8800GT.

Several observations: 

1) With vesa video driver everything works fine (alas, the user interface is
very unresponsive and everything feels sooooo slow).

2) With *nv* and nvidia drivers everything is broken.

3) I haven't test noveou driver because I run vanilla 2.6.25.6 kernel with no
patches applied.

4) After I have downgraded to xorg-x11-server-Xorg-1.3.0.0-33.fc8.i386
everything works fine with *any* driver, thus the culprit is *definitely* the
new X.org server.

This bug is *not* reproducible on any hardware other than 8 series of NVIDIA GPU's.

Comment 3 Artem S. Tashkinov 2008-06-12 15:12:04 UTC
Created attachment 309082 [details]
KDE3 konsole (run with --noxft) with Xserver 1.5

Comment 4 Dave Airlie 2008-06-12 22:57:48 UTC
can you upgrade to the latest F9 server here:
http://kojipkgs.fedoraproject.org/packages/xorg-x11-server/1.4.99.902/3.20080612.fc9/

It should be in updates quite soon and lets us know if it still happens?

Comment 5 Artem S. Tashkinov 2008-06-13 07:54:57 UTC
I will notify you as soon as I upgrade.

Comment 6 Jason Salcido 2008-06-16 13:31:50 UTC
I have the same problem with fonts on F9.  I have upgraded to latest xorg server
and still have this problem.  I ran the application and get smudged fonts with
either --noxft  or changing the font to something like Console.  I have an
nVidia Quadro-FX 570M (thinkpad) using nvidia driver. I have been pursuing a
similar bug in wine with font rendering. 

http://www.codeweavers.com/support/forums/general/?;t=26;msg=34034

Comment 7 Artem S. Tashkinov 2008-06-16 16:22:33 UTC
The X.org update from comment #4 hasn't changed anything. The problem persists.

Comment 8 Matthew Gillen 2008-06-18 13:44:23 UTC
I can confirm the same font problem when using the proprietary NVidia driver. 
The problem is solved (both for the QT application cited above, and crossover
office) by using the (open source) 'nv' Xorg driver (instead of the proprietary
'nvidia' one).

Incidentally, NVidia seems to be working on fixing the proprietary driver:
http://www.nvnews.net/vbulletin/showthread.php?t=114446
Quote: "This is a known issue that will be fixed in the next driver release."

For the record, I'm running Fedora 9 x86_64, on a dell laptop with an NVidia
Quadro NVS 135M video card (using nvidia proprietary driver version 173.14.05).

I suggest closing the ticket, since the resolution seems to be squarely in
NVidia's hands.

Comment 9 Artem S. Tashkinov 2008-06-19 17:13:34 UTC
NVIDIA 173.14.09 driver has solved the issue but it still persists as for 'nv'
open source driver.