Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-22249

Symbian/Simulator QRasterPaintEngine::drawTextItem produces a crash when trying to render Asian fonts, after displaying a web site with a particular font

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P3: Somewhat important
    • None
    • 4.7.3, 4.7.4
    • GUI: Font handling
    • Qt 4.7.3 and 4.7.4(from git) running on Simulator

    Description

      This happens when running a Qt app on Symbian and Simulator.
      After loading a Chinese/Korean translation and than using a QWebView to display "http://www.adidas.com/us/micoach/", the Qt crashes with a segmentation fault when trying to redraw the UI text.

      The crash occurs because the website loads some custom fonts:

      /**
       * @Font Settings		Global font settings for AdiHuas
       **/
      
      @font-face {
          font-family: 'AdiHausBold';
          src: url('fonts/adihdb__-webfont.eot');
          src: url('fonts/adihdb__-webfont.eot?#iefix') format('embedded-opentype'),
               url('fonts/adihdb__-webfont.woff') format('woff'),
               url('fonts/adihdb__-webfont.ttf') format('truetype'),
               url('fonts/adihdb__-webfont.svg#') format('svg');
          font-weight: normal;
          font-style: normal;
      }
      
      @font-face {
          /*font-family: 'AdiHausPSMd';*/
          font-family: 'AdiHaus';
          src: url('fonts/adihausps-md-webfont.eot');
          src: url('fonts/adihausps-md-webfont.eot?#iefix') format('embedded-opentype'),
               url('fonts/adihausps-md-webfont.woff') format('woff'),
               url('fonts/adihausps-md-webfont.ttf') format('truetype'),
               url('fonts/adihausps-md-webfont.svg#AdiHausPSMd') format('svg');
          font-weight: normal;
          font-style: normal;
      }
      
      .adiHaus { font-family:"AdiHaus",Helvetica,Arial,sans-serif !important; }
      
      

      This is the debug dump:
      0 QRasterPaintEngine::drawTextItem qpaintengine_raster.cpp 3404 0x7ffff404b6f4
      1 QPainter::drawTextItem qpainter.cpp 6566 0x7ffff3fd1ebe
      2 QTextLine::draw qtextlayout.cpp 2375 0x7ffff40def37
      3 QTextLayout::draw qtextlayout.cpp 1305 0x7ffff40da6c8
      4 QDeclarativeTextLayout::draw qdeclarativetextlayout.cpp 349 0x7ffff7940e23
      5 QDeclarativeTextPrivate::drawTextLayout qdeclarativetext.cpp 525 0x7ffff79180bf
      6 QDeclarativeText::paint qdeclarativetext.cpp 1594 0x7ffff791a6c1
      7 QGraphicsScenePrivate::draw qgraphicsscene.cpp 4962 0x7ffff453eac1
      8 QGraphicsScenePrivate::drawSubtreeRecursive qgraphicsscene.cpp 4855 0x7ffff453e46c
      9 QGraphicsScenePrivate::draw qgraphicsscene.cpp 4981 0x7ffff453ec05
      10 QGraphicsScenePrivate::drawSubtreeRecursive qgraphicsscene.cpp 4855 0x7ffff453e46c
      11 QGraphicsScenePrivate::draw qgraphicsscene.cpp 4981 0x7ffff453ec05
      12 QGraphicsScenePrivate::drawSubtreeRecursive qgraphicsscene.cpp 4855 0x7ffff453e46c
      13 QGraphicsScenePrivate::draw qgraphicsscene.cpp 4981 0x7ffff453ec05
      14 QGraphicsScenePrivate::drawSubtreeRecursive qgraphicsscene.cpp 4855 0x7ffff453e46c
      15 QGraphicsScenePrivate::drawItems qgraphicsscene.cpp 4737 0x7ffff453d83b
      16 QGraphicsView::paintEvent qgraphicsview.cpp 3469 0x7ffff456b5d3
      17 QDeclarativeView::paintEvent qdeclarativeview.cpp 714 0x7ffff7831433
      18 QWidget::event qwidget.cpp 8458 0x7ffff3eda16d
      19 QFrame::event qframe.cpp 557 0x7ffff42e5475
      20 QAbstractScrollArea::viewportEvent qabstractscrollarea.cpp 1043 0x7ffff438c01f

      And this is the Qt code that fires the segmentation fault

      #if defined(Q_WS_QWS) || defined(Q_WS_SIMULATOR)
          if (fontEngine->type() == QFontEngine::Box) {
              fontEngine->draw(this, qFloor(p.x() + aliasedCoordinateDelta), qFloor(p.y() + aliasedCoordinateDelta), ti);
              return;
          }
      
          if (s->matrix.type() < QTransform::TxScale
              && (fontEngine->type() == QFontEngine::QPF1 || fontEngine->type() == QFontEngine::QPF2
                  || (fontEngine->type() == QFontEngine::Proxy
                      && !(static_cast<QProxyFontEngine *>(fontEngine)->drawAsOutline()))
                  )) {
              fontEngine->draw(this, qFloor(p.x() + aliasedCoordinateDelta), qFloor(p.y() + aliasedCoordinateDelta), ti);
              return;
          }
      #endif // Q_WS_QWS   
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            liaqi Liang Qi
            kkrzewniak Krzysztof Krzewniak
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes