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. freetype example one.png
          5 kB
          James Larcombe
        2. freetype example two.png
          5 kB
          James Larcombe
        3. freetype floor 143.PNG
          4 kB
          James Larcombe
        4. freetype floor 145.PNG
          4 kB
          James Larcombe
        5. freetype x 2.79.png
          38 kB
          James Larcombe
        6. freetype x 2.8.png
          38 kB
          James Larcombe
        7. glyph-pos-inaccuracy.zip
          3 kB
          James Larcombe
        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