From: Abdelrazak Younes Date: Fri, 27 Oct 2006 13:36:23 +0000 (+0000) Subject: MacOSX optimisation: X-Git-Tag: 1.6.10~12168 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=d916db37b0521be02e7daf5494166dc1fac6a7f3;p=features.git MacOSX optimisation: * QLPainter::paintText(): use the font width cache instead of the painter metrics. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15580 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/QLPainter.C b/src/frontends/qt4/QLPainter.C index b08a0ae698..2423c4b9a7 100644 --- a/src/frontends/qt4/QLPainter.C +++ b/src/frontends/qt4/QLPainter.C @@ -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); }