]> git.lyx.org Git - features.git/blobdiff - src/frontends/qt4/QLPainter.C
MacOSX optimisation:
[features.git] / src / frontends / qt4 / QLPainter.C
index b08a0ae698c16f77469576d0a336a1f70d306b09..2423c4b9a721908efdf20aac75bbd513558a7c4f 100644 (file)
@@ -242,7 +242,10 @@ int QLPainter::text(int x, int y, char_type const * s, size_t ls,
                // We need to draw the text as LTR as we use our own bidi code.
                setLayoutDirection(Qt::LeftToRight);
                drawText(x, y, str);
-               textwidth = fontMetrics().width(str);
+               // Here we use the font width cache instead of
+               //   textwidth = fontMetrics().width(str);
+               // because the above is awfully expensive on MacOSX
+               textwidth = guiApp->guiFontLoader().metrics(f).width(s, ls);
        } else {
                textwidth = smallCapsText(x, y, str, f);
        }