[Qt-interest] QFont::defaultFamily() takes ridiculous share of CPU time, but only on Windows

Atlant Schmidt aschmidt at dekaresearch.com
Thu Apr 7 20:16:58 CEST 2011


Philipp:

  I'm glad I could help!

  (I've been spending some time down in the
  Qt Font logic lately.)

                        Atlant

-----Original Message-----
From: qt-interest-bounces+aschmidt=dekaresearch.com at qt.nokia.com [mailto:qt-interest-bounces+aschmidt=dekaresearch.com at qt.nokia.com] On Behalf Of Philipp Münzel
Sent: Thursday, April 07, 2011 14:13
To: qt-interest at qt.nokia.com
Subject: Re: [Qt-interest] QFont::defaultFamily() takes ridiculous share of CPU time, but only on Windows

Hey Atlant,

this was a good idea that put me on the right track.
Apparantly, I'm printing some character that the "Inconsolata" font doesn't have. Then defaultFamily() gets called to print this character from another, similar-looking font family.

Apparently, there is complicated stuff going on on Windows to find a matching font. But if I say
    mono_8.setStyleHint(QFont::TypeWriter);
the matching font is known beforehand.

That speeded up the rendering on Windows incredibly !

I wonder why on Linux Qt was smart enough to guess a Monospace replacement font without me setting the hint.

So thanks for the valueable input.

Regards,
Philipp


On 07.04.2011 15:33 "Atlant Schmidt" <aschmidt at dekaresearch.com> wrote:
> Philipp:
>
> > How and why gets QFont::defaultFamily() called
> > in the scenario described above?
>
>   Perhaps your Linux machine has the "Inconsolata" font
>   and your Windows machine doesn't, so Qt spends a lot
>   of time deciding which fall-back font to use?
>
>
_______________________________________________
Qt-interest mailing list
Qt-interest at qt.nokia.com
http://lists.qt.nokia.com/mailman/listinfo/qt-interest

This e-mail and the information, including any attachments, it contains are intended to be a confidential communication only to the person or entity to whom it is addressed and may contain information that is privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender and destroy the original message.

Thank you.

Please consider the environment before printing this email.



More information about the Qt-interest-old mailing list