]> git.lyx.org Git - features.git/commitdiff
* workaround for Qt not selecting a Times font on Mac with Qt 4.3.0. As soon as the
authorStefan Schimanski <sts@lyx.org>
Mon, 4 Jun 2007 12:10:30 +0000 (12:10 +0000)
committerStefan Schimanski <sts@lyx.org>
Mon, 4 Jun 2007 12:10:30 +0000 (12:10 +0000)
  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

src/frontends/qt4/GuiFontLoader.cpp

index d50c3cc4f32cb71553ebac107b5c69f93230ef28..1114d4419205023ef309e6101ae168539dc8d9bf 100644 (file)
@@ -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)));