[Interest] problem with QFontComboBox on mac/os

maitai maitai at virtual-winds.org
Fri Jun 12 07:38:15 CEST 2015


Hello,

Thanks for replying

In fact this QFontComboBox is part of a rather big dialog managing all 
application settings. By default we do not change the default font but 
the user may decide to. This in fact has been requested by people with 
impaired vision, but generally users are happy with the default font. 
The problem is that as soon as they decide to change something else they 
end up with the first (fancy) font available in the box, just because I 
cannot select the current default font in the list. It works on other 
platforms (linux/windows), it's just a problem on mac. Since Qt uses 
this font by default, it sounds reasonable to me to present it in the 
various font boxes, maybe with a family name of "System font" as you 
suggested.

Note that the font's defaultFamily is also missing in the list, and also 
that the problem is also visible in creator/design mode where it 
proposes a default item that do not exists.

As I said in that case I now try to select a decent font instead of the 
first one, but this is not a good solution.

Tell me if you think this is worth a ticket.

Thanks again
Philippe.

Le 11-06-2015 23:29, deDietrich Gabriel a écrit :
> Hi,
> 
> Yes, this is normal, in a way. OS X has this notion of private fonts,
> which basically correspond to the system fonts. We make it possible to
> be used inside Qt, and set it as the default font but, because of its
> nature, we keep it hidden from the end-user. The same happens with a
> native font picker on OS X. That is, this font is not visible to the
> end-user. The only exception is within Xcode, where it is simply
> called "System font".
> 
> If you can share your motivation for exposing such font, we will see
> what's possible to improve.
> 
> Best regards,
> 
> Dr. Gabriel de Dietrich
> Senior Software Developer
> The Qt Company — www.qt.io
> 
> 
> ________________________________________
> From:
> interest-bounces+gabriel.dedietrich=theqtcompany.com at qt-project.org
> <interest-bounces+gabriel.dedietrich=theqtcompany.com at qt-project.org>
> on behalf of maitai <maitai at virtual-winds.org>
> Sent: Thursday, June 11, 2015 8:37 PM
> To: Interest at qt-project.org
> Subject: [Interest] problem with QFontComboBox on mac/os
> 
> Hello,
> 
> I'm using qt 5.4.2 on Mac OS X 10.0-YOSEMITE.
> 
> I have a plain basic QFontComboxBox with all default options (all fonts
> allowed, etc). I'm trying to set the current font to whatever is
> QApplication::font().
> 
> I tried both
> 
> box->setCurrentText(qApp->font().family());
> 
> and
> 
> box->setCurrentFont(qApp->font());
> 
> but this does not work, because strangely enough there is no such 
> family
> font listed in the QFontComboBox...
> 
> qApp->font().family() returns ".Helvetica Neue DeskInterface". The
> closest match in the list is "Helvetica Neue" but it cannot find it.
> 
> As a result when the user presses OK the font is set to the first font
> listed, which is "Al Bayan" and gives nice results if you like fancy
> fonts ;)
> 
> I ended up removing "." and " DeskInterface" from the string returned 
> by
> qApp->font().policy() but this is just sad...
> 
> Any clue?
> 
> Thanks
> Philippe Lelong
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest



More information about the Interest mailing list