#include "GuiFontLoader.h"
#include "FontLoader.h"
-#include "FontInfo.h"
+#include "Font.h"
#include "GuiFontMetrics.h"
#include "qt_helpers.h"
#include "support/Package.h"
#include "support/os.h"
+#include "GuiApplication.h"
+
#include <QFontInfo>
#include <QFontDatabase>
(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);
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");