src/gui/text/qfontengine.cpp
branchRCL_3
changeset 7 3f74d0d4af4c
parent 5 d3bac044e0f0
equal deleted inserted replaced
6:dee5afe5301f 7:3f74d0d4af4c
   377     positions.resize(current);
   377     positions.resize(current);
   378     glyphs_out.resize(current);
   378     glyphs_out.resize(current);
   379     Q_ASSERT(positions.size() == glyphs_out.size());
   379     Q_ASSERT(positions.size() == glyphs_out.size());
   380 }
   380 }
   381 
   381 
       
   382 void QFontEngine::getGlyphBearings(glyph_t glyph, qreal *leftBearing, qreal *rightBearing)
       
   383 {
       
   384     glyph_metrics_t gi = boundingBox(glyph);
       
   385     bool isValid = gi.isValid();
       
   386     if (leftBearing != 0)
       
   387         *leftBearing = isValid ? gi.x.toReal() : 0.0;
       
   388     if (rightBearing != 0)
       
   389         *rightBearing = isValid ? (gi.xoff - gi.x - gi.width).toReal() : 0.0;
       
   390 }
   382 
   391 
   383 glyph_metrics_t QFontEngine::tightBoundingBox(const QGlyphLayout &glyphs)
   392 glyph_metrics_t QFontEngine::tightBoundingBox(const QGlyphLayout &glyphs)
   384 {
   393 {
   385     glyph_metrics_t overall;
   394     glyph_metrics_t overall;
   386 
   395 
  1383         glyphs.glyphs[i] = hi | glyphs.glyphs[i];
  1392         glyphs.glyphs[i] = hi | glyphs.glyphs[i];
  1384 
  1393 
  1385     return overall;
  1394     return overall;
  1386 }
  1395 }
  1387 
  1396 
       
  1397 void QFontEngineMulti::getGlyphBearings(glyph_t glyph, qreal *leftBearing, qreal *rightBearing)
       
  1398 {
       
  1399     int which = highByte(glyph);
       
  1400     engine(which)->getGlyphBearings(stripped(glyph), leftBearing, rightBearing);
       
  1401 }
       
  1402 
  1388 void QFontEngineMulti::addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs,
  1403 void QFontEngineMulti::addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs,
  1389                                         QPainterPath *path, QTextItem::RenderFlags flags)
  1404                                         QPainterPath *path, QTextItem::RenderFlags flags)
  1390 {
  1405 {
  1391     if (glyphs.numGlyphs <= 0)
  1406     if (glyphs.numGlyphs <= 0)
  1392         return;
  1407         return;