src/gui/text/qfontmetrics.cpp
changeset 19 fcece45ef507
parent 18 2f34d5167611
child 14 c0432d11811c
--- a/src/gui/text/qfontmetrics.cpp	Fri Apr 16 15:50:13 2010 +0300
+++ b/src/gui/text/qfontmetrics.cpp	Mon May 03 13:17:34 2010 +0300
@@ -472,8 +472,9 @@
     int nglyphs = 9;
     engine->stringToCMap(&ch, 1, &glyphs, &nglyphs, 0);
     // ### can nglyphs != 1 happen at all? Not currently I think
-    glyph_metrics_t gi = engine->boundingBox(glyphs.glyphs[0]);
-    return qRound(gi.x);
+    qreal lb;
+    engine->getGlyphBearings(glyphs.glyphs[0], &lb);
+    return qRound(lb);
 }
 
 /*!
@@ -506,8 +507,9 @@
     int nglyphs = 9;
     engine->stringToCMap(&ch, 1, &glyphs, &nglyphs, 0);
     // ### can nglyphs != 1 happen at all? Not currently I think
-    glyph_metrics_t gi = engine->boundingBox(glyphs.glyphs[0]);
-    return qRound(gi.xoff - gi.x - gi.width);
+    qreal rb;
+    engine->getGlyphBearings(glyphs.glyphs[0], 0, &rb);
+    return qRound(rb);
 }
 
 /*!
@@ -1317,8 +1319,9 @@
     int nglyphs = 9;
     engine->stringToCMap(&ch, 1, &glyphs, &nglyphs, 0);
     // ### can nglyphs != 1 happen at all? Not currently I think
-    glyph_metrics_t gi = engine->boundingBox(glyphs.glyphs[0]);
-    return gi.x.toReal();
+    qreal lb;
+    engine->getGlyphBearings(glyphs.glyphs[0], &lb);
+    return lb;
 }
 
 /*!
@@ -1351,8 +1354,10 @@
     int nglyphs = 9;
     engine->stringToCMap(&ch, 1, &glyphs, &nglyphs, 0);
     // ### can nglyphs != 1 happen at all? Not currently I think
-    glyph_metrics_t gi = engine->boundingBox(glyphs.glyphs[0]);
-    return (gi.xoff - gi.x - gi.width).toReal();
+    qreal rb;
+    engine->getGlyphBearings(glyphs.glyphs[0], 0, &rb);
+    return rb;
+
 }
 
 /*!