cmake-gui: avoid undefined font in recent macOS

Since commit 8fb74f97ef (ENH: Use fixed pitch font in output window,
2008-03-07), cmake-gui has been using a "Courier" font to print mono
spaced text in the output window, but at least in macOS 12, Courier
is no longer availablemand therefore will print the following warning
in the invoking terminal:

    qt.qpa.fonts: Populating font family aliases took 175 ms. Replace uses of missing font family "Courier" with one that exists to avoid this cost.

Change it to use "Courier New" instead, which has been provided as an
automatically selected alternative in Windows and comes preinstalled
in both systems, and add a hint to pull another monospaced font if not.
This commit is contained in:
Carlo Marcelo Arenas Belón 2022-04-14 13:18:54 -07:00 committed by Brad King
parent dd193fa3d3
commit 072b318893

View File

@ -226,7 +226,8 @@ CMakeSetupDialog::CMakeSetupDialog()
this->SourceDirectory->setCompleter(new QCMakeFileCompleter(this, true));
// fixed pitch font in output window
QFont outputFont("Courier");
QFont outputFont("Courier New");
outputFont.setStyleHint(QFont::Monospace);
this->Output->setFont(outputFont);
this->ErrorFormat.setForeground(QBrush(Qt::red));