X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt%2FGuiFontLoader.cpp;h=a47e55509295e8a05017029bc07637a9a86f7e54;hb=635a7d77;hp=80d45f6afcc5d0571a613c6540a6beabce676ddc;hpb=10272e474790d25ae9b5f3d272423959422ddfbd;p=lyx.git diff --git a/src/frontends/qt/GuiFontLoader.cpp b/src/frontends/qt/GuiFontLoader.cpp index 80d45f6afc..a47e555092 100644 --- a/src/frontends/qt/GuiFontLoader.cpp +++ b/src/frontends/qt/GuiFontLoader.cpp @@ -14,7 +14,7 @@ #include "GuiFontLoader.h" #include "FontLoader.h" -#include "FontInfo.h" +#include "Font.h" #include "GuiFontMetrics.h" #include "qt_helpers.h" @@ -29,6 +29,8 @@ #include "support/Package.h" #include "support/os.h" +#include "GuiApplication.h" + #include #include @@ -129,8 +131,8 @@ GuiFontInfo & fontinfo(FontInfo const & f) (f.size() < NUM_SIZE); if (!fontIsRealized) { // We can reset the font to something sensible in release mode. + LYXERR0("Unrealized font!" << f); LATTEST(false); - LYXERR0("Unrealized font!"); FontInfo f2 = f; f2.realize(sane_font); GuiFontInfo * & fi = fontinfo_ptr(f2); @@ -207,14 +209,16 @@ QFont symbolFont(QString const & family, bool * ok) upper[0] = family[0].toUpper(); QFont font; -#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); + } font.setStyleStrategy(QFont::NoFontMerging); #if QT_VERSION >= 0x040800 font.setStyleName("LyX");