}
+int GuiFontMetrics::width(QString const & ucs2) const
+{
+ int const ls = ucs2.size();
+ if (ls == 1 && !smallcaps_shape_) {
+ return width(ucs2[0].unicode());
+ }
+
+ if (smallcaps_shape_)
+ return smallcapsWidth(ucs2);
+
+ int w = 0;
+ for (int i = 0; i < ls; ++i)
+ w += width(ucs2[i].unicode());
+
+ return w;
+}
+
+
int GuiFontMetrics::signedWidth(docstring const & s) const
{
if (s[0] == '-')
#include "QLPainter.h"
#include "GuiApplication.h"
+#include "GuiFontMetrics.h"
#include "GuiWorkArea.h"
#include "QLImage.h"
#include "language.h"
#include "LColor.h"
-#include "frontends/FontMetrics.h"
#include "support/unicode.h"
// 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);
+ textwidth = fi.metrics->width(str);
} else {
textwidth = smallCapsText(x, y, str, f);
}