MacOS and MS Shell Dlg 2
-
wrote on 19 Feb 2025, 16:15 last edited by
Building and running on MacOS:
I get this at run time:
Qt Warn: (:0) Populating font family aliases took 139 ms. Replace uses of missing font family "MS Shell Dlg 2" with one that exists to avoid this cost.
Why?
David -
I asked perplexity.ai for you. She said:
"""
This warning occurs when a Qt application tries to use a font family that is not available on the system, resulting in a delay as Qt searches for a substitute. To resolve this issue, you can:-
Specify an Existing Font: Replace the missing font (
"MS Shell Dlg 2"
) with one that exists on your system usingQFont::setFamily()
. For example:QFont font; font.setFamily("Arial"); // Replace with a commonly available font QApplication::setFont(font);
-
Add Font Substitutions: Use
QFontDatabase::addApplicationFont()
to load custom fonts orQFont::insertSubstitution()
to define substitutes for missing fonts[2][5][8]. -
Initialize Fonts Early: Set the desired font in the
QApplication
constructor to avoid delays during runtime[4]. -
Check System Fonts: Ensure that the required fonts are installed on your system. If not, install them or modify the application to use available fonts[7].
These steps should eliminate the warning and improve performance.
Citations:
[1] https://forum.freecad.org/viewtopic.php?t=86309
[2] https://doc.qt.io/qt-6/qfont.html
[3] https://bugs.dolphin-emu.org/issues/12035
[4] https://forum.qt.io/topic/119302/missing-font-family-warning-on-macos
[5] https://ftp.nmr.mgh.harvard.edu/pub/dist/freesurfer/tutorial_versions/freesurfer/lib/qt/qt_doc/html/qfont.html
[6] https://www.qt.io/blog/text-improvements-in-qt-6.7
[7] https://gitlab.kitware.com/paraview/paraview/-/issues/20278
[8] http://osr600doc.xinuos.com/en/SDK_qt3/qfont.html
[9] https://dreamswork.github.io/qt4/classQFont.html
Antwort von Perplexity: https://www.perplexity.ai/search/qt-warn-0-populating-font-fami-lIbFHxT3ShW45OSjAcG0Ow?utm_source=copy_output
""" -
-
wrote on 19 Feb 2025, 19:00 last edited by
But, but I don't specify that font anywhere
-
You should double check, and otherwise you need to tell us more about your app and environment.
-
wrote on 19 Feb 2025, 20:34 last edited by
@Perdrix something in your application is trying to create a
QFont
with this font family name, this isn't smoke without fire. Maybe it is a 3rd party library. More likely - since this font family isn't real but is a "magic name" that Windows uses to refer to the current UI font. it could indicate some sort of cross contamination between the Windows and macOS versions of your app or in your environment. Perhaps it is some settings you copied from Windows to Mac? Or a HTML that you exported from a Windows version and tried to import to the Mac version? -
wrote on 20 Feb 2025, 15:51 last edited byThis post is deleted!
-
wrote on 20 Feb 2025, 15:53 last edited by
Grrr foundit in a ui file - excuse me while I shoot the developer (no not I).
-
wrote on 20 Feb 2025, 16:10 last edited by
I also found Segoe UI as well as MS Shell Dlg 2 both of which are windows specific. What should I use to replace these?
-
I also found Segoe UI as well as MS Shell Dlg 2 both of which are windows specific. What should I use to replace these?
9/9