Skip to content

Fix missing glyphs when using NativeRendering

When we look up glyphs with subpixel positions in the glyph cache, we use the calculated subpixel position (from a set of predefined subpixel positions) as key. In some very rare cases, we could end up with different subpixel positions when looking up an on-screen position than when we entered it into the cache, due to numerical differences when doing the calculation.

The reason for this was that when entering the glyph into the cache, we used the 16.6 fixed point representation, whereas when looking up, we used the unmodified float. In some cases, the converted fixed point approximation might snap to a different predefined subpixel position than the floating point equivalent.

To avoid this, we reuse the converted fixed point positions when looking up the glyphs in the cache.

[ChangeLog][Text] Fixed an issue where text using NativeRendering would sometimes be missing glyphs.

Pick-to: 5.15 6.2 6.4 6.5 Fixes: QTBUG-108713 Change-Id: Iecc264eb3d27e875c24257eaefcfb18a1a5fb5be Reviewed-by: Qt CI Bot Reviewed-by: Lars Knoll (cherry picked from commit 4bad3299)

Build log:

Closes qt/backports-tracker#2214 (closed)

Edited by Fushan Wen

Merge request reports