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.
    libGL.so.1
    libXmu.so.6
    libXrender.so.1
    libXrandr.so.2
    libXcursor.so.1
    libXinerama.so.1
    libXft.so.2
    libfreetype.so.6
    libfontconfig.so.1
    libexpat.so.1
    libxcb-dri3.so.0
    libxcb-present.so.0
    libxcb-sync.so.1
    libxshmfence.so.1
    libglapi.so.0
    libXdamage.so.1
    libXfixes.so.3
    libX11-xcb.so.1
    libxcb-glx.so.0
    libxcb-dri2.so.0
    libXxf86vm.so.1
    libdrm.so.2
    libXt.so.6
    libz.so.1
    libpng12.so.0
    libSM.so.6
    libICE.so.6
    libuuid.so.1
    Those libs haven't been linked to my new libqt-mt.so.3.3.8.
    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: http://www.linuxquestions.org/questions/slackware-14/font-antialiasing-of-qt3-apps-in-slack64-734774/ 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 ktechlab-build.sh here: https://github.com/megastallman/ktechlab-0.3.7-appimage
    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
    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
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.