qt5base-lts/tests/auto/shared/resources
Eskil Abrahamsen Blomfeldt fccd419dd6 Remove false Q_UNREACHABLE from shaping code
This was added by 9ff76c27b9 on
the basis that it signifies a shaping error and would later assert
or crash.

But the line is easily reachable by user code. If Harfbuzz returns
0 glyphs, it just means it is unable to shape the string, for instance
if the input string only contains default ignorables (like a ZWJ)
and does not have any appropriate glyph to use for replacement.

Qt expects there to always be at least one glyph in the output
(num_glyphs == 0 is used to indicate shaping is not yet done), so
to avoid asserts later on, we simply populate the output with a
single 0 token, which is a required entry in the font that is
reserved for representing unrepresentable characters.

This also adds a test and therefore a zero-width joiner to the test
font to reproduce the issue.

[ChangeLog][QtGui][Text] Fixed a possible crash with certain fonts
when shaping strings consisting only of control characters.

Fixes: QTBUG-89155
Pick-to: 5.15
Pick-to: 6.0
Change-Id: Ia0dd6a04844c9be90dcab6c464bebe339a3dab11
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2021-02-03 09:44:44 +01:00
..
test.ttf Remove false Q_UNREACHABLE from shaping code 2021-02-03 09:44:44 +01:00
testfont_condensed.ttf Make self-contained test of condensed font matching and width 2016-10-16 00:11:13 +00:00
testfont_italic.ttf Read font selection flags and use them when querying for metrics 2018-11-30 16:15:03 +00:00
testfont_open.otf QWindowsFontDatabase: Check preferred family names for all fonts 2019-11-29 09:31:21 +01:00
testfont.ttf