Subject: pkg/34709: QT3 Tutorial errors with "couldn't open fontconfigs chosen font with Xft!!!"
To: None <,,>
From: None <>
List: pkgsrc-bugs
Date: 10/04/2006 05:45:00
>Number:         34709
>Category:       pkg
>Synopsis:       QT3 Tutorial errors with "couldn't open fontconfigs chosen font with Xft!!!"
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Oct 04 05:45:00 +0000 2006
>Originator:     Kenneth Freidank
>Release:        3.99.21 & userland
NetBSD papadog.genken 3.99.21 NetBSD 3.99.21 (XSPD) #0: Thu Jul 13 07:51:25 EST 2006  solomon@papadog.genken:/usr/obj/sys/arch/i386/compile/XSPD i386
The QT3 source is configured to use Xft2, resulting in the following message every time a program using the QT3 framework tries to get a font.
     couldn't open fontconfigs chosen font with Xft!!!

I honestly don't know if the problem is that QT3 needs Xft as opposed to Xft2, or if fontconfigs and Xft2 are not working together.  

1) Build & install QT3.  Only use packages from pkgsrc.  (I always make a package since I have other targets)
     $cd /usr/pkgsrc/x11/qt3-tools       <-- this will install qt3 libs also
     #make clean
     #make package
2) Follow directions to compile a QT3 tutorial "Hello World", by placing source in a main.cpp file.
3) Setup the compile environment for QT3.  I used "netbsd-g++" mkspecs, since I'm compiling on NetBSD.
     $export QMAKESPEC=/usr/pkg/qt3/mkspecs/netbsd-g++
     $export QTDIR=/usr/pkg/qt3
4) Generate the QT project file "".
     $qmake -project
5) Add the following line to the file generated by qmake.
     TARGET = go
6) Generate the makefile.
7) Build the target.
8) Execute the target.
9) The program will run, producing a window with Hello World.  However, the command line from where the program runs will show the error message:
couldn't open fontconfigs chosen font with Xft!!!

The following fix, simply removes Xft as the font provider for QT3.  It does not fix the problem between QT3, Xft2, and fontconfig.

1) Change directories to the package source for qt3 libs
     $cd /usr/pkgsrc/x11/qt3-libs
2) Edit Makefile.common.
3) Find the CONFIGURE_ARGS lines and add the following:
     CONFIGURE_ARGS+= -no-xft
3.5)  You can probably comment out the dependency on Xft2 in the Makefile, since the -no-xft arguement will force the QT3 build to skip it...I would think.  However, I did not try this.
     #.include "../../fonts/Xft2/"
4) Build and install QT3.

The problem seems to be that Xft2 is what the qt3-libs package lists as a dependency, but qt3-libs really requires Xft.  Other developers I know, who are using QT3, only have Xft installed, not Xft2.  The above steps will prevent QT3 from using Xft and fontconfig.