Reputation: 1
I am drawing a font table in Qt. I noticed that when I draw the table directly on the screen and when I draw it first on an qimage and then draw this image on the screen, the letters are shifted a few pixels.
When I draw directly on the screen, drawText draws at the coordinate I want, but when I draw on the image, drawText draws 2 pixels right and 2 pixels down from the coordinate I want. My coordinates are float. I use the same coordinates in both drawings.
I create an Arial 16 font and set HintingPreference::PreferNoHinting. Both painters use this font. Also, when I use font metrics values, I use QFontMetricsF. Thank you for your help. Version Qt 5.13.2.
pixel shift in the photo below
Upvotes: 0
Views: 46