src/gui/text/qfontmetrics.cpp
branchRCL_3
changeset 7 3f74d0d4af4c
parent 4 3b1da2848fc7
child 13 c0432d11811c
--- a/src/gui/text/qfontmetrics.cpp	Mon Mar 15 12:43:09 2010 +0200
+++ b/src/gui/text/qfontmetrics.cpp	Thu Apr 08 14:19:33 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;
+
 }
 
 /*!