Commit 78da1028 authored by Eskil Abrahamsen Blomfeldt's avatar Eskil Abrahamsen Blomfeldt
Browse files

Make text decorations consistent between ways of drawing text


The drawGlyphRun() and drawStaticText() functions would calculate
the horizontal origin of the decorations based on the left-most edge
of the left-most glyph, in practice including the left bearing of
that glyph in the position. But in drawText()/QTextLayout it will
always be drawn from the position given as input by the user of the
function.

The inconsistency was detected in an upgrade of Harfbuzz NG, where
the tests on macOS would get a -0.05 left bearing, and as a result
the decorations would be painted one pixel to the left in
drawGlyphRun()/drawStaticText() compared to QTextLayout.

It is not a big deal in practice, but in order to get the Harfbuzz
update in, we fix the inconsistency now, by passing the user-input
position into the decoration function.

This was also an opportunity to consolidate the two code paths, and
to unexport the qt_draw_decoration_for_glyphs() symbol, which was
exported in Qt 4 only to be usable by Qt Quick 1.

Change-Id: I243404b2710ae378e84d7587efae719da3879944
Reviewed-by: default avatarLars Knoll <lars.knoll@qt.io>
parent 31911d38
Showing with 72 additions and 81 deletions
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment