Important: Please read the Qt Code of Conduct -

Ugly fonts in qt-x11-free-3.3.8b(needed for an old application)

  • Hi, one of the deprecated applications I'm using is built on top of ancient qt-x11-free-3.3.8b and kdelibs. I build it on top of my Kubuntu 16.04(x86_64). Everything works as expected, except the fonts, are distorted. To see this problem on early stage I can just build qt3 and start the "designer". I've tried using patches from Fedora Project, but the fonts remain distorted as well. Can I do any force font assignment and maybe bundle it with the application prefix. By the way, it was successfully built on Gentoo about 4 years ago, so now I'm using an old prefix(/opt/qt3), copied from my former Gentoo rootfs.

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    If you know a font that is working correctly, you can bundle it with your application and load it in QFontDatabase to use it with your application.

    Hope it helps

  • @SGaist Hi, the docs say that "This function was introduced in Qt 4.2.", but I have 3.3.8.
    I've done ldd with the old Gentoo working build and the new build(with crippled fonts). Here is the difference.
    Those libs haven't been linked to my new
    Maybe that can be a reason?

  • Lifetime Qt Champion

    If you have it working properly on your old Gentoo, you should rather bundle all the dependencies from your Gentoo machine and use them with your application.

  • Of course, but I'm trying to get a reproduceble build for Ubuntu. Loooks like I miss some font-specific and rendering deps. Here: was the same problem, which the Slackusers resolved by rebuild, so, Slackware seems(or seemed) to have the right headers. I'm gonna try bundling all the deps to my prefix(/opt/qt3) one by one. Maybe somehow I figure out what's missing. I really don't want to do a reproduceble build in a Gentoo chroot :)

  • I've resolved that problem at last. See the here:
    There is really a problem with the Freetype2 headers include. So, anyone who needs to build qt-x11-free-3.3.8b needs to do the following:

    cd $SRC/qt-x11-free-3.3.8b
    echo yes | ./configure -prefix $PREFIX -thread -shared -fast -no-exceptions -platform linux-g++ -no-pch -stl -sm -xshape -xinerama -xcursor -xrandr -xrender -xft -tablet -xkb -system-zlib -system-libpng -system-libmng -system-libjpeg -enable-opengl -dlopen-opengl -qt-gif -qt-imgfmt-png -qt-imgfmt-jpeg -plugin-imgfmt-mng -I/usr/include/freetype2 -lfontconfig -L/usr/lib/x86_64-linux-gnu
    sed -i s/ptrdiff_t/std::ptrdiff_t/g include/qmap.h
    sed -i s/ptrdiff_t/std::ptrdiff_t/g include/qvaluelist.h
    sed -i s/ptrdiff_t/std::ptrdiff_t/g include/qvaluevector.h
    sed -i s/ptrdiff_t/std::ptrdiff_t/g src/tools/qvaluelist.h
    sed -i s/ptrdiff_t/std::ptrdiff_t/g src/tools/qmap.h
    make install

  • Lifetime Qt Champion

    Glad you found out and thanks for sharing !

    Since you have it working now please mark the thread as solved using the "Topic Tools" button so that other forum users may know a solution has been found :)

Log in to reply