-#if defined Q_WS_X11 || defined(QPA_XCB)
- // On *nix we have to also specify the foundry to be able to
- // discriminate our fonts when the texlive fonts are managed by
- // fontconfig. Unfortunately, doing the same on Windows breaks things.
- font.setFamily(family + QLatin1String(" [LyEd]"));
-#else
- font.setFamily(family);
-#endif
+ if (guiApp->platformName() == "qt4x11"
+ || guiApp->platformName() == "xcb"
+ || guiApp->platformName().contains("wayland")) {
+ // On *nix we have to also specify the foundry to be able to
+ // discriminate our fonts when the texlive fonts are managed by
+ // fontconfig. Unfortunately, doing the same on Windows breaks things.
+ font.setFamily(family + QLatin1String(" [LyEd]"));
+ } else {
+ font.setFamily(family);
+ }