qt6-bb10/tests/auto/gui/text
Eskil Abrahamsen Blomfeldt 583a81cc1c Don't include bearing of mid-string characters in max width
When calculating the maximum width of a text layout, we
would add the text width of each substring *after* we had
added the negative right bearing of the last character to it.
But the bearing of the last character in a wrapped substring
does not actually add to the maximum width unless it is the
last character of the *whole* string.

Prior to 250117086ff15bba79df8f0e15ee66192edc9ea9 this was
not noticed, because the last glyph in the substring would
typically be a space and the space does not have any
bearings (when doing wrapping on individual characters it
could still happen). After the change, the previous glyph
for which we get the right bearing will be the last
non-whitespace glyph. If this happened to have a negative
right bearing, we would add this to the max width and
end up with a larger max width than we should.

This caused a test failure in tst_qquicktext.

This test prefers the text width without the bearing (i.e.
the *advance* of the substring) unless the line is manually
wrapped or it is the last line of the layout.

Change-Id: Iba1a5ad48d575683672400f0572dfa683a0f2d9c
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
(cherry picked from commit c08a92307d6d9fa9d9d9a1f301e3f2a65374e99a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 610ee0c5040cac4989a1f624e7678f83668e99a0)
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2025-01-16 11:57:47 +01:00
..
qabstracttextdocumentlayout Fix test compilation issues with QtLite configuration 2024-05-06 14:29:02 +00:00
qcssparser QTextHtmlParser: Handle fractional font-size pixel values 2024-08-13 12:08:27 +00:00
qfont test: Fix test for oblique/italic equivalence 2024-11-19 13:06:56 +00:00
qfontcache Change license for tests files 2024-02-04 09:56:42 +01:00
qfontdatabase Support application fallbacks for common script 2024-05-21 07:24:03 +02:00
qfontmetrics Introduce flag to use typographical line metrics for fonts 2024-05-31 19:30:53 +02:00
qglyphrun Change license for tests files 2024-02-04 09:56:42 +01:00
qinputcontrol Change license for tests files 2024-02-04 09:56:42 +01:00
qrawfont Tests: check the output of QFile::open 2024-03-27 04:24:11 +01:00
qstatictext Change license for tests files 2024-02-04 09:56:42 +01:00
qsyntaxhighlighter Change license for tests files 2024-02-04 09:56:42 +01:00
qtextblock Change license for tests files 2024-02-04 09:56:42 +01:00
qtextcursor Fix test compilation issues with QtLite configuration 2024-05-06 14:29:02 +00:00
qtextdocument Support SVG specific stroke styling properties 2024-05-14 21:48:12 +03:00
qtextdocumentfragment QTextHtmlImporter: don't forget to appendBlock after block tag closed 2024-03-01 08:01:45 -07:00
qtextdocumentlayout Fix test compilation issues with QtLite configuration 2024-05-06 14:29:02 +00:00
qtextformat Fix test compilation issues with QtLite configuration 2024-05-06 14:29:02 +00:00
qtextimagehandler QTextDocument: Add support for responsive images 2024-05-07 12:28:59 -07:00
qtextlayout Don't include bearing of mid-string characters in max width 2025-01-16 11:57:47 +01:00
qtextlist Fix test compilation issues with QtLite configuration 2024-05-06 14:29:02 +00:00
qtextmarkdownimporter QTextMarkdownWriter: escape all backslashes 2024-03-26 00:47:37 -07:00
qtextmarkdownwriter Replace 'Qt Designer' and 'Qt Widgets Designer' in code 2024-05-16 13:04:41 +01:00
qtextobject Change license for tests files 2024-02-04 09:56:42 +01:00
qtextodfwriter Respect QTextDocument::defaultFont() in ODF writer 2024-08-19 19:42:55 +00:00
qtextpiecetable Change license for tests files 2024-02-04 09:56:42 +01:00
qtextscriptengine Revert "Don't do font merging for PUA characters" 2024-03-18 09:09:07 +01:00
qtexttable Fix test compilation issues with QtLite configuration 2024-05-06 14:29:02 +00:00
CMakeLists.txt Fix test compilation issues with QtLite configuration 2024-05-06 14:29:02 +00:00