From: Stefan Schimanski Date: Mon, 4 Jun 2007 12:10:30 +0000 (+0000) Subject: * workaround for Qt not selecting a Times font on Mac with Qt 4.3.0. As soon as the X-Git-Tag: 1.6.10~9501 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=7990a764dc9a6666fba55bd306e7c8c6fe30ca1e;p=features.git * workaround for Qt not selecting a Times font on Mac with Qt 4.3.0. As soon as the bug is fixed in Qt an upper version bound should be added. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18647 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/GuiFontLoader.cpp b/src/frontends/qt4/GuiFontLoader.cpp index d50c3cc4f3..1114d44192 100644 --- a/src/frontends/qt4/GuiFontLoader.cpp +++ b/src/frontends/qt4/GuiFontLoader.cpp @@ -221,10 +221,21 @@ QLFontInfo::QLFontInfo(Font const & f) boost::tie(font, tmp) = getSymbolFont(pat); } else { switch (f.family()) { - case Font::ROMAN_FAMILY: - font.setFamily(toqstr(makeFontName(lyxrc.roman_font_name, - lyxrc.roman_font_foundry))); + case Font::ROMAN_FAMILY: { + QString family = toqstr(makeFontName(lyxrc.roman_font_name, + lyxrc.roman_font_foundry)); + font.setFamily(family); +#ifdef Q_WS_MACX +#if QT_VERSION >= 0x040300 + // Workaround for a Qt bug, see http://bugzilla.lyx.org/show_bug.cgi?id=3684 + // It is reported to Trolltech at 02/06/07 against 4.3 final. + // FIXME: Add an upper version limit as soon as the bug is fixed in Qt. + if (family == "Times" && !font.exactMatch()) + font.setFamily(QString::fromLatin1("Times New Roman")); +#endif +#endif break; + } case Font::SANS_FAMILY: font.setFamily(toqstr(makeFontName(lyxrc.sans_font_name, lyxrc.sans_font_foundry)));