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

No floating point precision in QPainter::drawText on raster device.

    XMLWordPrintable

Details

    • d79a9b1a4f694a227ce62ccab9b44685a9755916 (qt/qtbase/dev)

    Description

      It seems to be something related to caching of glyphs.
      If a glyph is cached, you don't get floating point precision.

      This seems strange since the position where the glyph is going to be
      painted, should have nothing to do with the caching of it.

      See also this "thread":
      http://www.qtcentre.org/threads/57280-QPainter-drawText-and-floating-point-precision

      Most interesting part from that thread might be this:
      "
      If I comment out line 3195 (or thereabout) in qpaintengine_raster.cpp, which looks like this:
      "if (!drawCachedGlyphs(glyphs.size(), glyphs.constData(), positions.constData(), fontEngine))"
      drawText works properly.
      "

      QPainter::drawGlyphRun has the same problem.

      Attachments

        1. glyph-pos-inaccuracy.zip
          3 kB
        2. freetype x 2.8.png
          freetype x 2.8.png
          38 kB
        3. freetype x 2.79.png
          freetype x 2.79.png
          38 kB
        4. freetype floor 145.PNG
          freetype floor 145.PNG
          4 kB
        5. freetype floor 143.PNG
          freetype floor 143.PNG
          4 kB
        6. freetype example two.png
          freetype example two.png
          5 kB
        7. freetype example one.png
          freetype example one.png
          5 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            kmatheussen Kjetil Matheussen
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes