[Interest] Fonts and Qt5

Frank Mertens frank at cyblogic.de
Mon Dec 14 23:56:30 CET 2015


On 14.12.2015 16:18, Duane wrote:
> We're moving our apps from Qt4.8 to Qt 5.5.  There seems to be an issue with fonts and font rendering.  Our targets are Windows Xp/7  and TinyCore Linux 5.
>
> For a sample test on Linux, I built a simple hello world app on both Qt4 and Qt5 with basically a new Qt main window and a couple labels. Without setting font or styles, the Qt4 label text looks fine but with Qt5 the font family looks different and the font size is half as large.
>
> Both on Windows and Linux we're using the open source versions installed by the online installer for Windows and the  maintenance tool for Linux.  No custom builds.
>
> One thing that I notice is that for my Linux build, if I check the font family using QApplciation::font(), on Qt4 I get DejaVu which exists on my system and the point size is 12.  With Qt5 this returns "Sans Serif" which doesn't exist and the point size is 9.  If I set the Qt5 version to use DejaVu with a point size of 12 this works.
>
> But this is not a solution for us as we use styles and style sheets and need to support several resolutions.
>
> Any idea what is different here?  Does the "default" Qt that gets installed with the online installer or maintenance tool have fontconfig support built in or not?
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest

Hi Duane,

2 ideas, here:
  * call QGuiApplication::setFont() in your main()
  * use qtconfig to setup Qt5 defaults

Greetings,

-- 
Cyblogic

Frank Mertens
Dornierstr. 19c
82110 Germering

Tel.: +49 (0) 176 22390536
Fax.: +49 (0) 89 20082454
Web.: gplus.to/frankencode



More information about the Interest mailing list