[Interest] Fonts and Qt5

Duane duane.hebert at group-upc.com
Tue Dec 15 16:20:21 CET 2015


On 15/12/2015 9:16 AM, Duane wrote:
> On 15/12/2015 4:30 AM, Thiago Macieira wrote:
>> On Monday 14 December 2015 23:56:30 Frank Mertens wrote:
>>> 2 ideas, here:
>>>    * call QGuiApplication::setFont() in your main()
>>>    * use qtconfig to setup Qt5 defaults
>>
>> There's no qtconfig for Qt 5.
>>
>> Recommendation: don't do anything. Qt is supposed to select the best
>> font for
>> you based on system defaults. Don't override it.
>>
>> If you think there's something wrong with the font it selected, that's a
>> different story.
>>
>
>
> Thanks for the replies.
>
> That's that issue though.  We were not setting an application font. With
> Qt 4 the font sizes were ok.  With Qt 5 the same code made the fonts
> very small.
>
> What I see is that when I don't set the family, it has Sans Serif as the
> family and the default size is 9.  When I set the font to DejaVu which
> exists, the point size is 12.  Doing some math, it actually sounds like
> 9 would be very small.  This doesn't make a lot of sense.
>
> I use this to test:
>
>    QFont f(QApplication::font());
>    qDebug()<< qPrintable(f.family()) << f.pointSize());
>    QApplication::setFont(QFont("DejaVu"));
>    f=QApplication::font();
>    qDebug()<< qPrintable(f.family()) << f.pointSize());
>
>
> What I don't understand is why the point size would be different.
>

Sorry forgot to put the output.
Sans Serif 9
DejaVu 12






More information about the Interest mailing list