From 4b09230d97c7002d488b822648968ee89e8e1f9a Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 8 May 2012 16:35:20 +0200 Subject: Avoid assert in QTextLayout for certain strings As in other shapers, we need to make sure that the default attributes of the first character is set before doing the greek-specific composition (which will set the attributes for characters > 0). The effect of this would be that the clusterStart did not default to true in the start of the string, and we would get an unexpected situation in addNextCluster() in QTextLayout which would cause an assert. The example in the task, which combines a greek polytonic (dasia-oxia: u1FDE) with a regular combining diacritic (asterisk under: u0359), is not a correct string, but should not cause an assert. Task-number: QTBUG-22864 Change-Id: Ieaff3cccbd10abc634e95e9a79dcde4c48504a3c Reviewed-by: Lars Knoll --- src/3rdparty/harfbuzz/src/harfbuzz-greek.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/3rdparty/harfbuzz') diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-greek.c b/src/3rdparty/harfbuzz/src/harfbuzz-greek.c index f3c0ff62ef..353685861f 100644 --- a/src/3rdparty/harfbuzz/src/harfbuzz-greek.c +++ b/src/3rdparty/harfbuzz/src/harfbuzz-greek.c @@ -372,6 +372,10 @@ HB_Bool HB_GreekShape(HB_ShaperItem *shaper_item) *shapedChars = *uc; logClusters[0] = 0; + attributes[0].mark = false; + attributes[0].clusterStart = true; + attributes[0].dontPrint = false; + for (i = 1; i < shaper_item->item.length; ++i) { hb_uint16 base = shapedChars[slen-1]; hb_uint16 shaped = 0; -- cgit v1.2.3