qt5base-lts/tests/auto/gui/text
Eskil Abrahamsen Blomfeldt 3e238113f8 Accept error margin in QGlyphRun/QStaticText test for decorations
When calculating the width of a text for drawing decorations on top,
we use the effective advance of the whole text after it has been
through the shaper.

However, in the case of QStaticText and QGlyphRun, there is shortcut:
Since we only have the glyph indexes and position of each glyph,
we use the position + advance of the right-most glyph to find the
right-most edge of the decoration. For this, however, we use the
advance of the glyph *out of context* of the rest of the string,
because the whole idea is to avoid doing the shaping of the string
with every draw call. In some rare cases, the advance of the
right-most character, in the context of the string, is different
from the advance of the standalone glyph.

Now, one way of fixing this would be to store the width of the
text in QStaticText and QGlyphRun, but since it is a very rare
artifact which is barely visible, I have opted to just work around
it in the test instead, the workaround being to force integer
metrics so that we don't get the small 0.2 pixel error.

Task-number: QTBUG-55217
Change-Id: I8d16d52f2ef27275cabb7d3865aeeaa31617ba3d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-02-02 15:10:41 +00:00
..
qabstracttextdocumentlayout Make imageAt and formatAt more robus against different font metrics 2016-08-12 03:59:23 +00:00
qcssparser Merge remote-tracking branch 'origin/5.7' into 5.8 2016-11-01 06:02:55 +01:00
qfont QFont: fix fromString(toString()) when application font has styleName 2017-01-11 15:15:39 +00:00
qfontcache Avoid synthesizing stretch on condensed font families 2016-08-15 11:39:44 +00:00
qfontdatabase Register fonts with preferred names on Windows 2016-11-23 10:04:47 +00:00
qfontmetrics Fix tst_QFontMetrics::elidedMultiLengthF with some fonts 2017-02-02 15:10:27 +00:00
qglyphrun Accept error margin in QGlyphRun/QStaticText test for decorations 2017-02-02 15:10:41 +00:00
qinputcontrol Accept all formatting characters as valid input 2017-01-26 10:59:49 +00:00
qrawfont Added capHeight() to QRawFont and QFontMetrics(F) 2016-08-15 18:27:06 +00:00
qstatictext Accept error margin in QGlyphRun/QStaticText test for decorations 2017-02-02 15:10:41 +00:00
qsyntaxhighlighter Updated license headers 2016-01-21 18:55:18 +00:00
qtextblock Updated license headers 2016-01-21 18:55:18 +00:00
qtextcursor Merge remote-tracking branch 'origin/5.6' into dev 2016-01-26 16:27:28 +01:00
qtextdocument Add QTextDocument::toRawText() function 2016-10-17 07:29:10 +00:00
qtextdocumentfragment Updated license headers 2016-01-21 18:55:18 +00:00
qtextdocumentlayout Merge "Merge remote-tracking branch 'origin/5.6' into dev" into refs/staging/dev 2016-01-26 11:27:37 +00:00
qtextformat Updated license headers 2016-01-21 18:55:18 +00:00
qtextlayout Merge remote-tracking branch 'origin/5.6' into 5.7 2016-11-15 09:58:16 +01:00
qtextlist Updated license headers 2016-01-21 18:55:18 +00:00
qtextobject Updated license headers 2016-01-21 18:55:18 +00:00
qtextodfwriter Updated license headers 2016-01-21 18:55:18 +00:00
qtextpiecetable Use qtConfig throughout in qtbase 2016-08-19 04:28:05 +00:00
qtextscriptengine Adjust some tests to pass with latest HB-NG changes 2017-02-02 15:10:37 +00:00
qtexttable Updated license headers 2016-01-21 18:55:18 +00:00
qzip update testdata 2016-08-31 10:00:29 +00:00
text.pro Accept ZWNJ, ZWJ and PUA characters in input widgets 2016-12-12 11:13:53 +00:00